Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ jobs:
GH_REPO: ${{ github.repository }}
TAG: ${{ github.ref_name }}
steps:
- name: Generate a token
id: app-token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
with:
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
permission-contents: write
- name: Download the archives
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
Expand All @@ -76,6 +83,10 @@ jobs:
run: gh release create "$TAG" --verify-tag --draft --generate-notes --title "$TAG"
- name: Upload the assets
run: gh release upload "$TAG" dist/* --clobber
# GITHUB_TOKEN starts no workflow run, so the app token publishes the
# release and starts the tap update.
- name: Publish the release
if: steps.state.outputs.state != 'published'
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: gh release edit "$TAG" --draft=false --latest
14 changes: 1 addition & 13 deletions .github/workflows/update-tap.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: Update Tap
on:
push:
tags: ["v*"]
release:
types: [published]
workflow_dispatch:
Expand All @@ -28,18 +26,8 @@ jobs:
env:
EVENT_TAG: ${{ github.event.release.tag_name }}
INPUT_TAG: ${{ inputs.tag }}
REF_TAG: ${{ github.ref_name }}
REF_TYPE: ${{ github.ref_type }}
run: |
if [[ -n "$EVENT_TAG" ]]; then
tag="$EVENT_TAG"
elif [[ -n "$INPUT_TAG" ]]; then
tag="$INPUT_TAG"
elif [[ "$REF_TYPE" == "tag" ]]; then
tag="$REF_TAG"
else
tag=""
fi
tag="${EVENT_TAG:-$INPUT_TAG}"
if [[ -z "$tag" ]]; then
echo "A release tag is required." >&2
exit 1
Expand Down
Loading