@@ -6,14 +6,13 @@ on:
66 push:
77 branches: [ master, main ]
88
9−concurrency:
10− group: ci-${{ github.ref }}
11− cancel-in-progress: true
12−
139jobs:
1410 build:
1511 name: Build & Lint
1612 runs-on: ubuntu-latest
13+ concurrency:
14+ group: ci-build-${{ github.ref }}
15+ cancel-in-progress: true
1716
1817 steps:
1918 - name: Checkout code
@@ -59,11 +58,14 @@ jobs:
5958 path: app/build/reports/lint-results-release.html
6059 retention-days: 14
6160
62− prerelease:
63− name: Create Prerelease
61+ release:
62+ name: Create Release
6463 needs: build
6564 if: github.event_name == 'push'
6665 runs-on: ubuntu-latest
66+ concurrency:
67+ group: release
68+ cancel-in-progress: false
6769 permissions:
6870 contents: write
6971
@@ -71,6 +73,11 @@ jobs:
7173 - name: Checkout code
7274 uses: actions/checkout@v4
7375
76+ - name: Set version from commit timestamp
77+ run: |
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
80+
7481 - name: Set up JDK 17
7582 uses: actions/setup-java@v4
7683 with:
@@ -89,31 +96,17 @@ jobs:
8996 - name: Build release APK
9097 run: ./gradlew assembleRelease
9198
92− - name: Rename APK with commit SHA
99+ - name: Rename APK with version
93100 run: |
94− SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
95101 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"
97103 done
98104
99− - name: Delete existing latest-master tag and release
100− env:
101− GH_TOKEN: ${{ github.token }}
102− run: |
103− gh release delete latest-master --yes || true
104− git push origin :refs/tags/latest-master || true
105−
106− - name: Create prerelease
105+ - name: Create release
107106 uses: softprops/action-gh-release@v2
108107 with:
109− tag_name: latest-master
110− name: "Latest Master Build (${{ github.sha }})"
111− prerelease: true
112− body: |
113− Automated prerelease from commit ${{ github.sha }}.
114−
115− **Commit:** [`${{ github.sha }}`](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }})
116− **Branch:** `${{ github.ref_name }}`
117− **Triggered by:** @${{ github.actor }}
108+ tag_name: v${{ env.VERSION_NAME }}
109+ name: v${{ env.VERSION_NAME }}
110+ generate_release_notes: true
118111 files: |
119112 app/build/outputs/apk/release/*.apk