Skip to content

Commit

Permalink
feat: Add binaries / Docker images to GitHub releases (#1259)
Browse files Browse the repository at this point in the history
- Add binaries / Docker images to GitHub releases
  • Loading branch information
fabergat authored Jan 29, 2025
1 parent 1fec105 commit 67778db
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Release workflow - Add the docker hub link to the release notes

on:
release:
types:
- published

permissions:
actions: write
contents: read
issues: write

jobs:
manual-approval:
name: Waiting for manual approval
runs-on: ubuntu-latest

steps:
- name: Wait for manual approval
uses: trstringer/manual-approval@662b3ddbc7685f897992051e87e1b4b58c07dc03 #v1.9.1
with:
secret: ${{ github.TOKEN }}
approvers: fabergat, aldur, matteojug, djordon
minimum-approvals: 1
issue-title: "Add Docker Hub link to the ${{ github.event.release.tag_name }} release notes"
issue-body: "Please approve or deny the ${{ github.ref_name }}. Wait the Build and Release sBTC Signer ${{ github.event.release.tag_name }} Docker Image workflow finish with a success."
exclude-workflow-initiator-as-approver: false

update-release:
name: Update Release Page
permissions: write-all
runs-on: ubuntu-latest
needs: manual-approval

steps:
- name: Get Docker Image Digest
id: docker-info
run: |
DOCKER_REPO="blockstack/sbtc"
TAG=${{ github.event.release.tag_name }}
DIGEST=$(curl -s https://hub.docker.com/v2/repositories/$DOCKER_REPO/tags/signer-$TAG | jq -r '.images[0].digest')
echo "link=hub.docker.com/layers/$DOCKER_REPO/signer-$TAG/images/$DIGEST" >> $GITHUB_ENV
- name: Update Release with Docker Image Link
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1
with:
script: |
const link = process.env.link;
await github.rest.repos.updateRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: context.payload.release.id,
body:
`
${context.payload.release.body}
**Release Docker Image:** [https://${link}](https://${link})
You can verify the attestation using this [guide](https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations/using-artifact-attestations-to-establish-provenance-for-builds#verifying-artifact-attestations-with-the-github-cli).
`
});
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 67778db

Please sign in to comment.