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
49 changes: 32 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,9 @@ env:
REPO: git-graph

jobs:
release:
name: Release for ${{ matrix.os }}
build:
name: Build for ${{ matrix.os }}
runs-on: ${{ matrix.os }}

# Explicitly grant GITHUB_TOKEN write access to attach binaries to the release
permissions:
contents: write

strategy:
matrix:
Expand Down Expand Up @@ -57,22 +53,41 @@ jobs:
- name: Compress
run: |
cp -f target/release/$REPO${{ matrix.bin_extension }} .
tar -czf release.tar.gz $REPO${{ matrix.bin_extension }}
ARCHIVE="$REPO-$RELEASE_VERSION-${{ matrix.os_name }}.tar.gz"
tar -czf $ARCHIVE $REPO${{ matrix.bin_extension }}
shell: bash

- name: Archive build artifacts
uses: actions/upload-artifact@v7
with:
name: ${{ env.REPO }}-${{ env.RELEASE_VERSION }}-${{ matrix.os_name }}
path: release.tar.gz
path: ${{ env.REPO }}-${{ env.RELEASE_VERSION }}-${{ matrix.os_name }}.tar.gz
if-no-files-found: error

release:
name: Create GitHub draft release
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: build

- name: Upload binaries to release
if: startsWith(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
# Explicitly grant GITHUB_TOKEN write access to attach binaries to the release
permissions:
contents: write

steps:
- name: Download build artifacts
uses: actions/download-artifact@v7
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: release.tar.gz
asset_name: ${{ env.REPO }}-${{ env.RELEASE_VERSION }}-${{ matrix.os_name }}.tar.gz
tag: ${{ github.ref }}
overwrite: true
draft: true
pattern: ${{ env.REPO }}-${{ github.ref_name }}-*
path: artifacts
merge-multiple: false

- name: Create draft release
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.ref_name }}
run: |
gh release create "$TAG" \
--draft \
--title "$TAG" \
artifacts/*/*.tar.gz
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [unreleased] - Next Date


## [0.8.2] - 2026-10-26
## [0.8.2] - 2026-10-27

### Changed

- Grant github release workflow permission to write binaries
- Grant github release workflow permission to write binaries.
- Split release workflow in two jobs.


## [0.8.1] - 2026-10-25
Expand Down
Loading