diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eb1e22a340..da2865dae4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -405,6 +405,7 @@ jobs: LINUX_ARCH: ${{ needs.set-metadata.outputs.linux_arch }} BUCKET: ${{ vars.S3_RELEASES_BUCKET }} GITHUB_REF_NAME: ${{ github.ref_name }} + WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -439,6 +440,7 @@ jobs: id: slack_msg env: RELEASE_TAG: ${{ env.RELEASE_TAG }} + WORKFLOW_URL: ${{ env.WORKFLOW_URL }} run: | text=$(./scripts/ci/format.sh slack) echo "text<> "$GITHUB_OUTPUT" diff --git a/scripts/ci/format.sh b/scripts/ci/format.sh index 5d9c0f3355..2347e97438 100755 --- a/scripts/ci/format.sh +++ b/scripts/ci/format.sh @@ -12,6 +12,7 @@ set -euo pipefail # BUILD_TYPE: production, beta, or nightly # GITHUB_REF_NAME: branch/tag name (e.g., main, v9.0.11) # GITHUB_SHA: commit SHA (required for release-notes) +# WORKFLOW_URL: workflow run URL (required for slack, used for nightly builds) # LINUX_ARCH: amd64, arm64, or all (optional, defaults to amd64) FORMAT="${1:?Format required: release-notes, job-summary, or slack}" @@ -38,8 +39,8 @@ VERSION="${RELEASE_TAG#v}" FULL_INSTALLER_NAME="${INSTALLER_BASE_NAME}" [[ -n "$BUILD_TYPE" && "$BUILD_TYPE" != "production" ]] && FULL_INSTALLER_NAME="${FULL_INSTALLER_NAME}-${BUILD_TYPE}" -VERSION_URL="https://${BUCKET}.s3.amazonaws.com/releases/${BUILD_TYPE}/${VERSION}" -LATEST_URL="https://${BUCKET}.s3.amazonaws.com/releases/${BUILD_TYPE}/latest" +VERSION_URL="https://s3.amazonaws.com/${BUCKET}/releases/${BUILD_TYPE}/${VERSION}" +LATEST_URL="https://s3.amazonaws.com/${BUCKET}/releases/${BUILD_TYPE}/latest" # Check if a platform should be included should_include() { @@ -111,7 +112,12 @@ job-summary) ;; slack) - text="Lantern $BUILD_TYPE is ready." + WORKFLOW_URL="${WORKFLOW_URL:?WORKFLOW_URL required for slack}" + if [[ "$BUILD_TYPE" == "nightly" ]]; then + text="Lantern $BUILD_TYPE <${WORKFLOW_URL}|$RELEASE_TAG> is ready." + else + text="Lantern $BUILD_TYPE is ready." + fi text="${text}\n*Branch:* " text="${text}\n*Downloads:*" diff --git a/scripts/ci/publish-to-s3.sh b/scripts/ci/publish-to-s3.sh index 0e34222c21..f87b655dc3 100755 --- a/scripts/ci/publish-to-s3.sh +++ b/scripts/ci/publish-to-s3.sh @@ -75,8 +75,8 @@ upload_file() { fi echo "✓ Uploaded $platform successfully" - echo " - https://${BUCKET}.s3.amazonaws.com/${VERSION_PREFIX}/${filename}" - echo " - https://${BUCKET}.s3.amazonaws.com/${LATEST_PREFIX}/${filename}" + echo " - https://s3.amazonaws.com/${BUCKET}/${VERSION_PREFIX}/${filename}" + echo " - https://s3.amazonaws.com/${BUCKET}/${LATEST_PREFIX}/${filename}" return 0 }