@@ -6,14 +6,13 @@ on:
7 branches: [ master, main ]
7 branches: [ master, main ]
10− group: ci-${{ github.ref }}
11− cancel-in-progress: true
15 name: Build & Lint
11 name: Build & Lint
16 runs-on: ubuntu-latest
12 runs-on: ubuntu-latest
14+ group: ci-build-${{ github.ref }}
15+ cancel-in-progress: true
19 - name: Checkout code
18 - name: Checkout code
@@ -59,11 +58,14 @@ jobs:
59 path: app/build/reports/lint-results-release.html
58 path: app/build/reports/lint-results-release.html
60 retention-days: 14
59 retention-days: 14
62− prerelease:
61+ release:
63− name: Create Prerelease
62+ name: Create Release
64 needs: build
63 needs: build
65 if: github.event_name == 'push'
64 if: github.event_name == 'push'
66 runs-on: ubuntu-latest
65 runs-on: ubuntu-latest
68+ cancel-in-progress: false
67 permissions:
69 permissions:
68 contents: write
70 contents: write
@@ -71,6 +73,11 @@ jobs:
71 - name: Checkout code
73 - name: Checkout code
72 uses: actions/checkout@v4
74 uses: actions/checkout@v4
76+ - name: Set version from commit timestamp
78+ VERSION_NAME=$(TZ=UTC git log -1 --format='%cd' --date=format-local:'%Y.%m.%d.%H%M')
79+ echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV
74 - name: Set up JDK 17
81 - name: Set up JDK 17
75 uses: actions/setup-java@v4
82 uses: actions/setup-java@v4
@@ -89,31 +96,17 @@ jobs:
89 - name: Build release APK
96 - name: Build release APK
90 run: ./gradlew assembleRelease
97 run: ./gradlew assembleRelease
92− - name: Rename APK with commit SHA
99+ - name: Rename APK with version
94− SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
95 for apk in app/build/outputs/apk/release/*.apk; do
101 for apk in app/build/outputs/apk/release/*.apk; do
96− mv "$apk" "app/build/outputs/apk/release/parseable-android-${SHORT_SHA}.apk"
102+ mv "$apk" "app/build/outputs/apk/release/parseable-android-${VERSION_NAME}.apk"
99− - name: Delete existing latest-master tag and release
105+ - name: Create release
101− GH_TOKEN: ${{ github.token }}
103− gh release delete latest-master --yes || true
104− git push origin :refs/tags/latest-master || true
106− - name: Create prerelease
107 uses: softprops/action-gh-release@v2
106 uses: softprops/action-gh-release@v2
109− tag_name: latest-master
108+ tag_name: v${{ env.VERSION_NAME }}
110− name: "Latest Master Build (${{ github.sha }})"
109+ name: v${{ env.VERSION_NAME }}
111− prerelease: true
110+ generate_release_notes: true
113− Automated prerelease from commit ${{ github.sha }}.
115− **Commit:** [`${{ github.sha }}`](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }})
116− **Branch:** `${{ github.ref_name }}`
117− **Triggered by:** @${{ github.actor }}
119 app/build/outputs/apk/release/*.apk
112 app/build/outputs/apk/release/*.apk