diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index bef5299152..bd23a33a69 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -11,7 +11,7 @@ on: - "android/**" - "assets/**" - "lib/**" - - ".releaserc.*" + - ".releaserc.js" - "pubspec.yaml" jobs: @@ -54,5 +54,5 @@ jobs: keyAlias: ${{ secrets.SIGNING_KEY_ALIAS }} keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }} run: | - echo "${{ secrets.SIGNING_KEYSTORE }}" | base64 --decode > app/keystore.jks + echo "${{ secrets.SIGNING_KEYSTORE }}" | base64 --decode > android/app/keystore.jks npx semantic-release diff --git a/.releaserc b/.releaserc.js similarity index 70% rename from .releaserc rename to .releaserc.js index 5cb27a15f7..aa47508a2c 100644 --- a/.releaserc +++ b/.releaserc.js @@ -1,4 +1,4 @@ -{ +module.exports = { "branches": [ "main", { @@ -17,16 +17,15 @@ "@semantic-release/changelog", "@semantic-release/release-notes-generator", [ - "@droidsolutions-oss/semantic-release-update-file", + "@semantic-release/exec", { - "files": [ - { - "path": ["pubspec.yaml"], - "type": "flutter", - "branches": ["main", "dev"] - } - ] - } + step: [ + 'IFS="." read -r -a nums <<< "${${nextRelease.version}/-dev/}.0"', + 'VERSIONCODE=$((nums[0] * 100000000 + nums[1] * 100000 + nums[2] * 100 + nums[3]))', + 'sed -i "/^version/c\\version: $VERSION+$VERSIONCODE" pubspec.yaml', + 'flutter build apk' + ].join(" && "), + }, ], [ "@semantic-release/git", @@ -55,4 +54,4 @@ } ] ] -} +};