@@ -36,25 +36,25 @@ jobs:
3636 run_ios : ${{ steps.platforms.outputs.run_ios }}
3737 steps :
3838 - uses : actions/checkout@v4
39+ with :
40+ fetch-depth : 0
41+ fetch-tags : true
3942
4043 - id : meta
4144 shell : bash
4245 env :
4346 GH_TOKEN : ${{ github.token }}
4447 run : |
45- RELEASE_LATEST =$(gh release list --json tagName -q=".[0].tagName" )
46- echo "version release (latest): $RELEASE_LATEST "
48+ TAG_LATEST =$(git describe --tags --abbrev=0 )
49+ echo "version tag (latest): $TAG_LATEST "
4750
48- RELEASE_BASE=$(echo "$RELEASE_LATEST " | awk -F'-' '{print $1}')
51+ RELEASE_BASE=$(echo "$TAG_LATEST " | awk -F'-' '{print $1}')
4952 echo "version base (current): $RELEASE_BASE"
5053
51- # increment the patch of the latest release by 1
54+ # increment the patch of the latest tag by 1
5255 RELEASE_BASE_NEXT=$(echo "$RELEASE_BASE" | awk -F'\\.' -v OFS='.' '{ $NF = $NF + 1; print }')
5356 echo "version base (next): $RELEASE_BASE_NEXT"
5457
55- # hardcoded for now so that the 9.0.0 release does not appear to be behind a nightly
56- RELEASE_BASE_NEXT="v9.0.0" # TODO: remove after "v9.0.0" release and allow to increment naturally
57-
5858 DATE=$(date -u +%Y%m%dT%H%M%SZ) # ISO 8601 without colons or dashes
5959 REF=$(git rev-parse --short HEAD)
6060 VER="${RELEASE_BASE_NEXT}-${REF}-${DATE}"
@@ -172,7 +172,7 @@ jobs:
172172 runs-on : ubuntu-latest
173173 env :
174174 INSTALLER_NAME : ${{ needs.set-nightly-metadata.outputs.installer_name }}
175- BUCKET : ${{ secrets .S3_RELEASES_BUCKET }}
175+ BUCKET : ${{ vars .S3_RELEASES_BUCKET }}
176176 RUN_MACOS : ${{ needs.set-nightly-metadata.outputs.run_macos }}
177177 RUN_WINDOWS : ${{ needs.set-nightly-metadata.outputs.run_windows }}
178178 RUN_ANDROID : ${{ needs.set-nightly-metadata.outputs.run_android }}
@@ -191,31 +191,29 @@ jobs:
191191 sha="$(git rev-parse --short HEAD)"
192192
193193 cat > release_notes.md <<EOF
194- ## Nightly Build
195194
196195 This is an automated nightly build from commit \`$sha\`.
197196
198197 **Branch:** \`${{ github.ref_name }}\`
199- **Build Date:** $(date -u +"%Y-%m-%d %H:%M:%S UTC")
200-
201- ### Downloads
202198 EOF
203199
204200 if [[ "$RUN_MACOS" == "true" ]]; then
205- echo "- macOS: \`${ INSTALLER_NAME}.dmg\` " >> release_notes.md
201+ echo "- macOS: https://$BUCKET.s3.amazonaws.com/nightly/${sha}/${ INSTALLER_NAME}.dmg" >> release_notes.md
206202 fi
207203 if [[ "$RUN_WINDOWS" == "true" ]]; then
208- echo "- Windows: \`${ INSTALLER_NAME}.exe\` " >> release_notes.md
204+ echo "- Windows: https://$BUCKET.s3.amazonaws.com/nightly/${sha}/${ INSTALLER_NAME}.exe" >> release_notes.md
209205 fi
210206 if [[ "$RUN_ANDROID" == "true" ]]; then
211- echo "- Android: \`${ INSTALLER_NAME}.apk\` " >> release_notes.md
207+ echo "- Android: https://$BUCKET.s3.amazonaws.com/nightly/${sha}/${ INSTALLER_NAME}.apk" >> release_notes.md
212208 fi
213209 if [[ "$RUN_LINUX" == "true" ]]; then
214- echo "- Linux: \`${INSTALLER_NAME}.deb\`, \`${INSTALLER_NAME}.rpm\`" >> release_notes.md
210+ echo "- Linux (.deb): https://$BUCKET.s3.amazonaws.com/nightly/${sha}/${INSTALLER_NAME}.deb" >> release_notes.md
211+ echo "- Linux (.rpm): https://$BUCKET.s3.amazonaws.com/nightly/${sha}/${INSTALLER_NAME}.rpm" >> release_notes.md
215212 fi
216213
217214 # Create the pre-release as a draft, because immutable releases
218215 # forbid uploading artifacts after publication.
216+ # Subsequent steps may either delete this or publish it.
219217 gh release create "$VERSION" \
220218 --draft \
221219 --prerelease \
@@ -326,17 +324,17 @@ jobs:
326324 {
327325 echo "## Nightly links (commit \`$sha\`)"
328326 if [[ "$RUN_MACOS" == "true" ]]; then
329- echo "- macOS: https://$BUCKET.s3.amazonaws.com/nightly/latest /${INSTALLER_NAME}.dmg"
327+ echo "- macOS: https://$BUCKET.s3.amazonaws.com/nightly/${sha} /${INSTALLER_NAME}.dmg"
330328 fi
331329 if [[ "$RUN_WINDOWS" == "true" ]]; then
332- echo "- Windows: https://$BUCKET.s3.amazonaws.com/nightly/latest /${INSTALLER_NAME}.exe"
330+ echo "- Windows: https://$BUCKET.s3.amazonaws.com/nightly/${sha} /${INSTALLER_NAME}.exe"
333331 fi
334332 if [[ "$RUN_ANDROID" == "true" ]]; then
335- echo "- Android: https://$BUCKET.s3.amazonaws.com/nightly/latest /${INSTALLER_NAME}.apk"
333+ echo "- Android: https://$BUCKET.s3.amazonaws.com/nightly/${sha} /${INSTALLER_NAME}.apk"
336334 fi
337335 if [[ "$RUN_LINUX" == "true" ]]; then
338- echo "- Linux DEB: https://$BUCKET.s3.amazonaws.com/nightly/latest /${INSTALLER_NAME}.deb"
339- echo "- Linux RPM: https://$BUCKET.s3.amazonaws.com/nightly/latest /${INSTALLER_NAME}.rpm"
336+ echo "- Linux DEB: https://$BUCKET.s3.amazonaws.com/nightly/${sha} /${INSTALLER_NAME}.deb"
337+ echo "- Linux RPM: https://$BUCKET.s3.amazonaws.com/nightly/${sha} /${INSTALLER_NAME}.rpm"
340338 fi
341339 } >> "$GITHUB_STEP_SUMMARY"
342340
@@ -345,20 +343,21 @@ jobs:
345343 id : slack_msg
346344 run : |
347345 sha="$(git rev-parse --short HEAD)"
348- text="Lantern nightly '${{ needs.set-nightly-metadata.outputs.version }}' is ready.\n*Branch:* '${{ github.ref_name }}'\n*Downloads:*"
346+ version="${{ needs.set-nightly-metadata.outputs.version }}"
347+ text="Lantern nightly <https://github.com/getlantern/lantern/releases/tag/$version|$version> is ready.\n*Branch:* '${{ github.ref_name }}'\n*Downloads:*"
349348
350349 if [[ "$RUN_MACOS" == "true" ]]; then
351- text="${text}\n• <https://${BUCKET}.s3.amazonaws.com/nightly/latest /${INSTALLER_NAME}.dmg|macOS>"
350+ text="${text}\n• <https://${BUCKET}.s3.amazonaws.com/nightly/${sha} /${INSTALLER_NAME}.dmg|macOS>"
352351 fi
353352 if [[ "$RUN_WINDOWS" == "true" ]]; then
354- text="${text}\n• <https://${BUCKET}.s3.amazonaws.com/nightly/latest /${INSTALLER_NAME}.exe|Windows>"
353+ text="${text}\n• <https://${BUCKET}.s3.amazonaws.com/nightly/${sha} /${INSTALLER_NAME}.exe|Windows>"
355354 fi
356355 if [[ "$RUN_ANDROID" == "true" ]]; then
357- text="${text}\n• <https://${BUCKET}.s3.amazonaws.com/nightly/latest /${INSTALLER_NAME}.apk|Android>"
356+ text="${text}\n• <https://${BUCKET}.s3.amazonaws.com/nightly/${sha} /${INSTALLER_NAME}.apk|Android>"
358357 fi
359358 if [[ "$RUN_LINUX" == "true" ]]; then
360- text="${text}\n• <https://${BUCKET}.s3.amazonaws.com/nightly/latest /${INSTALLER_NAME}.deb|Linux (.deb)>"
361- text="${text}\n• <https://${BUCKET}.s3.amazonaws.com/nightly/latest /${INSTALLER_NAME}.rpm|Linux (.rpm)>"
359+ text="${text}\n• <https://${BUCKET}.s3.amazonaws.com/nightly/${sha} /${INSTALLER_NAME}.deb|Linux (.deb)>"
360+ text="${text}\n• <https://${BUCKET}.s3.amazonaws.com/nightly/${sha} /${INSTALLER_NAME}.rpm|Linux (.rpm)>"
362361 fi
363362
364363 # Expose as output
0 commit comments