mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
ci: Improve build workflow (#1668)
This commit is contained in:
parent
b115643034
commit
088a3b7c28
40
.github/workflows/release-build.yml
vendored
40
.github/workflows/release-build.yml
vendored
@ -11,9 +11,9 @@ on:
|
||||
- "android/**"
|
||||
- "assets/**"
|
||||
- "lib/**"
|
||||
- ".releaserc.*"
|
||||
- ".releaserc.js"
|
||||
- "pubspec.yaml"
|
||||
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
@ -40,20 +40,6 @@ jobs:
|
||||
- name: Setup semantic-release
|
||||
run: npm install
|
||||
|
||||
- name: Get version code
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
npx semantic-release --extends ./.releaserc.getversion.json --no-ci --dry-run
|
||||
echo "RELEASE_VERSION=v$(cat .VERSION)" >> $GITHUB_ENV
|
||||
|
||||
- name: Bump pubspec version
|
||||
run: |
|
||||
VERSION=$(echo "${RELEASE_VERSION}" | sed 's/v//')
|
||||
IFS='.' read -r -a nums <<< "${VERSION/-dev/}.0"
|
||||
VERSIONCODE=$((nums[0] * 100000000 + nums[1] * 100000 + nums[2] * 100 + nums[3]))
|
||||
sed -i "/^version/c\\version: $VERSION+$VERSIONCODE" pubspec.yaml
|
||||
|
||||
- name: Set up Flutter
|
||||
run: flutter pub get
|
||||
|
||||
@ -61,22 +47,12 @@ jobs:
|
||||
run: dart run build_runner build --delete-conflicting-outputs
|
||||
|
||||
- name: Build with Flutter
|
||||
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 }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
signingKey: "keystore.jks"
|
||||
keyStorePassword: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }}
|
||||
keyAlias: ${{ secrets.SIGNING_KEY_ALIAS }}
|
||||
keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }}
|
||||
|
||||
- name: Rename APK
|
||||
run: mv ${{steps.sign_apk.outputs.signedFile}} revanced-manager-${{ env.RELEASE_VERSION }}.apk
|
||||
|
||||
- name: Publish release APK
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: npx semantic-release --extends ./.releaserc.release.json
|
||||
run: |
|
||||
echo "${{ secrets.SIGNING_KEYSTORE }}" | base64 --decode > android/app/keystore.jks
|
||||
npx semantic-release
|
||||
|
@ -1,24 +0,0 @@
|
||||
{
|
||||
"branches": [
|
||||
"main",
|
||||
{
|
||||
"name": "dev",
|
||||
"prerelease": true
|
||||
}
|
||||
],
|
||||
"plugins": [
|
||||
[
|
||||
"@semantic-release/commit-analyzer", {
|
||||
"releaseRules": [
|
||||
{ "type": "build", "scope": "Needs bump", "release": "patch" }
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
"@semantic-release/exec",
|
||||
{
|
||||
"verifyReleaseCmd": "echo ${nextRelease.version} > .VERSION"
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
84
.releaserc.js
Normal file
84
.releaserc.js
Normal file
@ -0,0 +1,84 @@
|
||||
module.exports = {
|
||||
"branches": [
|
||||
"main",
|
||||
{
|
||||
"name": "dev",
|
||||
"prerelease": true
|
||||
}
|
||||
],
|
||||
"plugins": [
|
||||
[
|
||||
"@semantic-release/commit-analyzer", {
|
||||
"releaseRules": [
|
||||
{ "type": "build", "scope": "Needs bump", "release": "patch" }
|
||||
]
|
||||
}
|
||||
],
|
||||
"@semantic-release/changelog",
|
||||
[
|
||||
"@semantic-release/release-notes-generator",
|
||||
{
|
||||
"preset": "conventionalcommits",
|
||||
writerOpts: {
|
||||
commitPartial: "* {{subject}} ([{{author.name}}]({{~@root.host}}/{{~@root.owner}}/{{~@root.repository}}/commit/{{hash}}))\n",
|
||||
mainTemplate: `
|
||||
{{#each commitGroups}}
|
||||
{{#if title}}
|
||||
## {{title}}
|
||||
{{/if}}
|
||||
{{#each commits}}
|
||||
{{> commit root=@root}}
|
||||
{{/each}}
|
||||
{{/each}}
|
||||
`
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
"@droidsolutions-oss/semantic-release-update-file",
|
||||
{
|
||||
"files": [
|
||||
{
|
||||
"path": ["pubspec.yaml"],
|
||||
"type": "flutter",
|
||||
"branches": ["main", "dev"]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
"@semantic-release/exec",
|
||||
{
|
||||
"prepareCmd": "flutter build apk"
|
||||
}
|
||||
],
|
||||
[
|
||||
"@semantic-release/git",
|
||||
{
|
||||
"assets": [
|
||||
"pubspec.yaml"
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
"@semantic-release/github",
|
||||
{
|
||||
"assets": [
|
||||
{
|
||||
"path": "build/app/outputs/apk/release/revanced-manager*.apk"
|
||||
}
|
||||
],
|
||||
"successComment": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"@saithodev/semantic-release-backmerge",
|
||||
{
|
||||
"backmergeBranches": [{"from": "main", "to": "dev"}],
|
||||
"clearWorkspace": true
|
||||
}
|
||||
]
|
||||
],
|
||||
|
||||
|
||||
};
|
@ -1,46 +0,0 @@
|
||||
{
|
||||
"branches": [
|
||||
"main",
|
||||
{
|
||||
"name": "dev",
|
||||
"prerelease": true
|
||||
}
|
||||
],
|
||||
"plugins": [
|
||||
[
|
||||
"@semantic-release/commit-analyzer", {
|
||||
"releaseRules": [
|
||||
{ "type": "build", "scope": "Needs bump", "release": "patch" }
|
||||
]
|
||||
}
|
||||
],
|
||||
"@semantic-release/changelog",
|
||||
"@semantic-release/release-notes-generator",
|
||||
[
|
||||
"@semantic-release/git",
|
||||
{
|
||||
"assets": [
|
||||
"pubspec.yaml"
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
"@semantic-release/github",
|
||||
{
|
||||
"assets": [
|
||||
{
|
||||
"path": "revanced-manager-v*.apk"
|
||||
}
|
||||
],
|
||||
"successComment": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"@saithodev/semantic-release-backmerge",
|
||||
{
|
||||
"backmergeBranches": [{"from": "main", "to": "dev"}],
|
||||
"clearWorkspace": true
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
@ -47,11 +47,30 @@ android {
|
||||
release {
|
||||
shrinkResources false
|
||||
minifyEnabled false
|
||||
resValue "string", "app_name", "ReVanced Manager"
|
||||
signingConfig signingConfigs.debug
|
||||
ndk {
|
||||
abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64'
|
||||
}
|
||||
if (System.getenv("signingKey") != null) {
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
storeFile = file(System.getenv("signingKey"))
|
||||
storePassword = System.getenv("keyStorePassword")
|
||||
keyAlias = System.getenv("keyAlias")
|
||||
keyPassword = System.getenv("keyPassword")
|
||||
}
|
||||
}
|
||||
signingConfig = signingConfigs.release
|
||||
resValue "string", "app_name", "ReVanced Manager"
|
||||
applicationVariants.all { variant ->
|
||||
variant.outputs.all {
|
||||
outputFileName = "revanced-manager-v${flutterVersionName}.apk"
|
||||
}
|
||||
}
|
||||
} else {
|
||||
signingConfig = signingConfigs.debug
|
||||
resValue "string", "app_name", "ReVanced Manager Debug"
|
||||
applicationIdSuffix ".debug"
|
||||
}
|
||||
}
|
||||
debug {
|
||||
shrinkResources false
|
||||
|
288
package-lock.json
generated
288
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,11 @@
|
||||
{
|
||||
"devDependencies": {
|
||||
"@droidsolutions-oss/semantic-release-update-file": "^1.3.2",
|
||||
"@saithodev/semantic-release-backmerge": "^4.0.1",
|
||||
"@semantic-release/changelog": "^6.0.3",
|
||||
"@semantic-release/exec": "^6.0.3",
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"conventional-changelog-conventionalcommits": "^7.0.2",
|
||||
"semantic-release": "^22.0.12"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user