Skip to content

Commit

Permalink
ci: Fix GH publish (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego authored Oct 12, 2023
1 parent 41f3b86 commit fd08cd5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
branches:
- main
workflow_dispatch:
inputs:
# Latest commit to include with the release. If omitted, use the latest commit on the main branch.
sha:
description: Commit SHA
type: string

permissions:
contents: write
Expand All @@ -18,6 +23,7 @@ jobs:
uses: release-drafter/release-drafter@v5
with:
config-name: release-drafter.yml
commitish: ${{ inputs.sha }}
disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 13 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ jobs:
name: binaries
path: binaries

# TODO: Publish only after uploading binaries
- name: Create and publish GitHub release
- name: Create GitHub release
id: github-release
uses: release-drafter/release-drafter@v5
with:
Expand All @@ -163,15 +162,20 @@ jobs:
version: ${{ needs.get-version.outputs.version }}
prerelease: ${{ needs.get-version.outputs.is-prerelease }}
commitish: ${{ inputs.sha }}
publish: ${{ inputs.dry-run == false }}
disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload binaries to GitHub release
uses: svenstaro/upload-release-action@v2
with:
file: binaries/*
file_glob: true
tag: ${{ steps.github-release.outputs.tag_name }}
overwrite: true
run: gh release upload $TAG $FILES --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ steps.github-release.outputs.tag_name }}
FILES: binaries/*

- name: Publish GitHub release
if: inputs.dry-run == false
run: gh release edit $TAG --draft=false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ steps.github-release.outputs.tag_name }}

0 comments on commit fd08cd5

Please sign in to comment.