mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
ci: use semantic-release
(#746)
This commit is contained in:
parent
ded59d2da0
commit
276f33b9ec
141
.github/workflows/commit-build.yml
vendored
141
.github/workflows/commit-build.yml
vendored
@ -1,141 +0,0 @@
|
|||||||
name: Android Release
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- "**"
|
|
||||||
tags-ignore:
|
|
||||||
- "v*"
|
|
||||||
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- "**"
|
|
||||||
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
version:
|
|
||||||
name: Create version number
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Fetch all history for all tags and branches
|
|
||||||
run: |
|
|
||||||
git config remote.origin.url https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
|
|
||||||
git fetch --prune --depth=10000
|
|
||||||
|
|
||||||
- name: Install GitVersion
|
|
||||||
uses: gittools/actions/gitversion/setup@v0.9.7
|
|
||||||
with:
|
|
||||||
versionSpec: "5.x"
|
|
||||||
|
|
||||||
- name: Use GitVersion
|
|
||||||
id: gitversion
|
|
||||||
uses: gittools/actions/gitversion/execute@v0.9.7
|
|
||||||
|
|
||||||
- name: Create version.txt with nuGetVersion
|
|
||||||
run: echo ${{ steps.gitversion.outputs.nuGetVersion }} > version.txt
|
|
||||||
|
|
||||||
- name: Upload version.txt
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: gitversion
|
|
||||||
path: version.txt
|
|
||||||
|
|
||||||
build:
|
|
||||||
name: Create Android Build
|
|
||||||
needs: version
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Get version.txt
|
|
||||||
uses: actions/download-artifact@v2
|
|
||||||
with:
|
|
||||||
name: gitversion
|
|
||||||
|
|
||||||
- name: Create new file without newline char from version.txt
|
|
||||||
run: tr -d '\n' < version.txt > version1.txt
|
|
||||||
|
|
||||||
- name: Read version
|
|
||||||
id: version
|
|
||||||
uses: juliangruber/read-file-action@v1
|
|
||||||
with:
|
|
||||||
path: version1.txt
|
|
||||||
|
|
||||||
- name: Update version in YAML
|
|
||||||
run: sed -i 's/99.99.99+99/${{ steps.version.outputs.content }}+${{ github.run_number }}/g' pubspec.yaml
|
|
||||||
|
|
||||||
- name: Download Android keystore
|
|
||||||
id: android_keystore
|
|
||||||
uses: timheuer/base64-to-file@v1.0.3
|
|
||||||
with:
|
|
||||||
fileName: upload-keystore.jks
|
|
||||||
encodedString: ${{ secrets.SIGNING_KEYSTORE }}
|
|
||||||
|
|
||||||
- name: Create key.properties
|
|
||||||
run: |
|
|
||||||
echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" > android/key.properties
|
|
||||||
echo "storePassword=${{ secrets.SIGNING_KEYSTORE_PASSWORD }}" >> android/key.properties
|
|
||||||
echo "keyPassword=${{ secrets.SIGNING_KEY_PASSWORD }}" >> android/key.properties
|
|
||||||
echo "keyAlias=${{ secrets.SIGNING_KEY_ALIAS }}" >> android/key.properties
|
|
||||||
|
|
||||||
- uses: actions/setup-java@v3
|
|
||||||
with:
|
|
||||||
distribution: 'zulu'
|
|
||||||
java-version: "12.x"
|
|
||||||
cache: gradle
|
|
||||||
|
|
||||||
- uses: subosito/flutter-action@v2
|
|
||||||
with:
|
|
||||||
channel: 'stable'
|
|
||||||
cache: true
|
|
||||||
|
|
||||||
- name: Get dependencies
|
|
||||||
run: flutter pub get
|
|
||||||
|
|
||||||
- name: Generate files with Builder
|
|
||||||
run: flutter packages pub run build_runner build --delete-conflicting-outputs
|
|
||||||
|
|
||||||
- name: Build with Flutter
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
|
|
||||||
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
|
|
||||||
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }}
|
|
||||||
run: flutter build apk
|
|
||||||
|
|
||||||
- name: Sign APK
|
|
||||||
id: sign_apk
|
|
||||||
uses: ilharp/sign-android-release@v1
|
|
||||||
with:
|
|
||||||
releaseDir: build/app/outputs/apk/release
|
|
||||||
signingKey: ${{ secrets.SIGNING_KEYSTORE }}
|
|
||||||
keyStorePassword: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }}
|
|
||||||
keyAlias: ${{ secrets.SIGNING_KEY_ALIAS }}
|
|
||||||
keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Add version to APK
|
|
||||||
run: mv ${{ steps.sign_apk.outputs.signedFile }} revanced-manager-${{ env.RELEASE_VERSION }}.apk
|
|
||||||
|
|
||||||
- name: Upload APK
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: revanced-manager-${{ env.RELEASE_VERSION }}
|
|
||||||
path: revanced-manager-${{ env.RELEASE_VERSION }}.apk
|
|
||||||
|
|
||||||
# deploy:
|
|
||||||
# name: Deploy Android Build
|
|
||||||
# needs: build
|
|
||||||
# runs-on: ubuntu-latest
|
|
||||||
# steps:
|
|
||||||
# - uses: actions/checkout@v1
|
|
||||||
# - name: Get Android Build from artifacts
|
|
||||||
# uses: actions/download-artifact@v2
|
|
||||||
# with:
|
|
||||||
# name: android-release
|
|
||||||
|
|
||||||
env:
|
|
||||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
|
36
.github/workflows/pull-request-build.yml
vendored
36
.github/workflows/pull-request-build.yml
vendored
@ -1,26 +1,30 @@
|
|||||||
name: "Android CI PR Build"
|
name: PR Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
workflow_dispatch:
|
||||||
branches:
|
|
||||||
- "**"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
build:
|
||||||
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout
|
||||||
- name: Set env
|
uses: actions/checkout@v3
|
||||||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
with:
|
||||||
- name: Set up JDK 12
|
# Make sure the release step uses its own credentials:
|
||||||
|
# https://github.com/cycjimmy/semantic-release-action#private-packages
|
||||||
|
persist-credentials: false
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Setup JDK
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
java-version: '12'
|
java-version: '17'
|
||||||
distribution: 'zulu'
|
distribution: 'zulu'
|
||||||
- uses: subosito/flutter-action@v2
|
- name: Setup Flutter
|
||||||
|
uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: 'stable'
|
channel: 'stable'
|
||||||
- name: Set up Flutter
|
- name: Install Flutter dependencies
|
||||||
run: flutter pub get
|
run: flutter pub get
|
||||||
- name: Generate files with Builder
|
- name: Generate files with Builder
|
||||||
run: flutter packages pub run build_runner build --delete-conflicting-outputs
|
run: flutter packages pub run build_runner build --delete-conflicting-outputs
|
||||||
@ -28,10 +32,8 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: flutter build apk
|
run: flutter build apk
|
||||||
- name: Add version to APK
|
- name: Upload build
|
||||||
run: mv build/app/outputs/flutter-apk/app-release.apk revanced-manager-${{ env.RELEASE_VERSION }}.apk
|
|
||||||
- name: Upload APK
|
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: revanced-manager-${{ env.RELEASE_VERSION }}
|
name: revanced-manager
|
||||||
path: revanced-manager-${{ env.RELEASE_VERSION }}.apk
|
path: build/app/outputs/flutter-apk/app-release.apk
|
||||||
|
@ -1,26 +1,38 @@
|
|||||||
name: "Release Build"
|
name: Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
tags:
|
branches:
|
||||||
- "v*"
|
- main
|
||||||
|
- dev
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
|
name: Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout
|
||||||
- name: Set env
|
uses: actions/checkout@v3
|
||||||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
with:
|
||||||
- name: Set up JDK 12
|
# Make sure the release step uses its own credentials:
|
||||||
|
# https://github.com/cycjimmy/semantic-release-action#private-packages
|
||||||
|
persist-credentials: false
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Setup JDK
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
java-version: '12'
|
java-version: '17'
|
||||||
distribution: 'zulu'
|
distribution: 'zulu'
|
||||||
- uses: subosito/flutter-action@v2
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: '18'
|
||||||
|
cache: 'npm'
|
||||||
|
- name: Setup Flutter
|
||||||
|
uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: 'stable'
|
channel: 'stable'
|
||||||
- name: Set up Flutter
|
- name: Install Flutter dependencies
|
||||||
run: flutter pub get
|
run: flutter pub get
|
||||||
- name: Generate files with Builder
|
- name: Generate files with Builder
|
||||||
run: flutter packages pub run build_runner build --delete-conflicting-outputs
|
run: flutter packages pub run build_runner build --delete-conflicting-outputs
|
||||||
@ -40,11 +52,16 @@ jobs:
|
|||||||
keyStorePassword: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }}
|
keyStorePassword: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }}
|
||||||
keyAlias: ${{ secrets.SIGNING_KEY_ALIAS }}
|
keyAlias: ${{ secrets.SIGNING_KEY_ALIAS }}
|
||||||
keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }}
|
keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }}
|
||||||
|
- name: Setup semantic-release
|
||||||
|
run: npm install
|
||||||
|
- name: Get release version
|
||||||
|
run: npx semantic-release --dry-run
|
||||||
|
id: get-next-version
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Add version to APK
|
- name: Add version to APK
|
||||||
run: mv ${{steps.sign_apk.outputs.signedFile}} revanced-manager-${{ env.RELEASE_VERSION }}.apk
|
run: mv ${{steps.sign_apk.outputs.signedFile}} revanced-manager-${{ steps.get-next-version.outputs.new-release-version }}.apk
|
||||||
- name: Publish release APK
|
- name: Release
|
||||||
uses: "marvinpinto/action-automatic-releases@latest"
|
env:
|
||||||
with:
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
run: npm exec semantic-release
|
||||||
prerelease: false
|
|
||||||
files: revanced-manager-${{ env.RELEASE_VERSION }}.apk
|
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -136,3 +136,6 @@ app.*.map.json
|
|||||||
|
|
||||||
Firebase related
|
Firebase related
|
||||||
.firebase
|
.firebase
|
||||||
|
|
||||||
|
# Depdenency directories
|
||||||
|
node_modules/
|
74
.releaserc
Normal file
74
.releaserc
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
{
|
||||||
|
"branches": [
|
||||||
|
"main",
|
||||||
|
{
|
||||||
|
"name": "dev",
|
||||||
|
"prerelease": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"plugins": [
|
||||||
|
"@semantic-release/commit-analyzer",
|
||||||
|
[
|
||||||
|
"@semantic-release/release-notes-generator",
|
||||||
|
{
|
||||||
|
"presetConfig": {
|
||||||
|
"types": [
|
||||||
|
{
|
||||||
|
"type": "build",
|
||||||
|
"section": "Dependency Updates"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "chore",
|
||||||
|
"section": "Other Changes",
|
||||||
|
"hidden": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "perf",
|
||||||
|
"section": "Performance Improvements",
|
||||||
|
"hidden": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "refactor",
|
||||||
|
"section": "Code Improvements",
|
||||||
|
"hidden": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"@semantic-release/changelog",
|
||||||
|
"semantic-release-dart",
|
||||||
|
[
|
||||||
|
"@semantic-release/git",
|
||||||
|
{
|
||||||
|
"assets": [
|
||||||
|
"CHANGELOG.md",
|
||||||
|
"pubspec.yaml"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"@semantic-release/github",
|
||||||
|
{
|
||||||
|
"assets": [
|
||||||
|
{
|
||||||
|
"path": "build/app/outputs/flutter-apk/revanced-manager-*.apk"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"successComment": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"@saithodev/semantic-release-backmerge",
|
||||||
|
{
|
||||||
|
"backmergeBranches": [
|
||||||
|
{
|
||||||
|
"from": "main",
|
||||||
|
"to": "dev"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"clearWorkspace": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
0
CHANGELOG.md
Normal file
0
CHANGELOG.md
Normal file
10338
package-lock.json
generated
Normal file
10338
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
9
package.json
Normal file
9
package.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"devDependencies": {
|
||||||
|
"@saithodev/semantic-release-backmerge": "^3.1.0",
|
||||||
|
"@semantic-release/changelog": "^6.0.2",
|
||||||
|
"@semantic-release/git": "^10.0.1",
|
||||||
|
"semantic-release": "^20.1.0",
|
||||||
|
"semantic-release-dart": "^1.0.0-alpha.1"
|
||||||
|
}
|
||||||
|
}
|
@ -4,7 +4,7 @@ homepage: https://github.com/revanced/revanced-manager
|
|||||||
|
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
version: 0.0.57+57
|
version: 0.0.57
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.17.5 <3.0.0"
|
sdk: ">=2.17.5 <3.0.0"
|
||||||
|
Loading…
Reference in New Issue
Block a user