Skip to content

Commit

Permalink
Build a draft release and then publish once complete
Browse files Browse the repository at this point in the history
  • Loading branch information
huonw committed Dec 6, 2024
1 parent 1dd15d7 commit 9e1534d
Showing 1 changed file with 28 additions and 12 deletions.
40 changes: 28 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,33 +94,49 @@ jobs:
'
cargo run -p package -- --dest-dir dist/ scie \
--scie-pants dist/scie-pants --tools-pex dist/tools.pex
# Build up a draft release with the artifacts from each of these jobs:
- name: Create ${{ needs.determine-tag.outputs.release-tag }} Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.determine-tag.outputs.release-tag }}
draft: true
# placeholder body to help someone track down why a release is still in draft:
body: "Release job in progress: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
files: dist/scie-pants-*
fail_on_unmatched_files: true

publish-announce-release:
name: Publish and Announce Release
needs:
- determine-tag
- github-release
runs-on: ubuntu-22.04
steps:
# Now, do the human-facing prep on the release (changelog etc.), and publish it
- name: Prepare Changelog
id: prepare-changelog
uses: a-scie/actions/[email protected]
with:
changelog-file: ${{ github.workspace }}/CHANGES.md
version: ${{ needs.determine-tag.outputs.release-version }}
setup-python: ${{ matrix.os == 'ubuntu-22.04' }}
- name: Create ${{ needs.determine-tag.outputs.release-tag }} Release
setup-python: true

- name: Publish ${{ needs.determine-tag.outputs.release-tag }} Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.determine-tag.outputs.release-tag }}
name: scie-pants ${{ needs.determine-tag.outputs.release-version }}
tag_name: ${{ needs.determine-tag.outputs.release-tag }}
body_path: ${{ steps.prepare-changelog.outputs.changelog-file }}
draft: false
prerelease: ${{ needs.determine-tag.outputs.prerelease }}
files: dist/scie-pants-*
fail_on_unmatched_files: true
discussion_category_name: Announcements
announce-release:
name: Announce Release
needs:
- determine-tag
- github-release
runs-on: ubuntu-22.04
steps:

# Announce the release! Yay
- name: Post Release Announcement to Pants Slack `#announce`
if: ${{ needs.determine-tag.outputs.prerelease != 'true' }}
id: slack
Expand Down

0 comments on commit 9e1534d

Please sign in to comment.