Skip to content

Commit 700b817

Browse files
doublegateclaude
andcommitted
ci: modernize release workflow with softprops/action-gh-release@v2
Replace deprecated `actions/create-release@v1` and `actions/upload-release-asset@v1` (both archived) with `softprops/action-gh-release@v2` which auto-detects the tag, uploads assets, and preserves existing release notes. - Remove separate `create-release` job and its `upload_url` output dependency chain — build jobs now upload directly - Add `permissions: contents: write` at workflow level for GITHUB_TOKEN to create/update releases - Unify asset upload into single step per build with `fail_on_unmatched_files: false` so Unix (.tar.gz) and Windows (.zip) builds don't fail on the other's missing archive format - Add Visual Studio solution files (*.sln, *.suo, *.user) to .gitignore under IDE/Editors section - Document all changes in CHANGELOG.md [Unreleased] section Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b21ca27 commit 700b817

3 files changed

Lines changed: 28 additions & 48 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,13 @@ on:
99
env:
1010
CARGO_TERM_COLOR: always
1111

12-
jobs:
13-
# Create release
14-
create-release:
15-
name: Create Release
16-
runs-on: ubuntu-latest
17-
outputs:
18-
upload_url: ${{ steps.create_release.outputs.upload_url }}
19-
version: ${{ steps.get_version.outputs.version }}
20-
steps:
21-
- uses: actions/checkout@v6
22-
23-
- name: Get version from tag
24-
id: get_version
25-
env:
26-
TAG_REF: ${{ github.ref }}
27-
run: echo "version=${TAG_REF#refs/tags/v}" >> $GITHUB_OUTPUT
28-
29-
- name: Create Release
30-
id: create_release
31-
uses: actions/create-release@v1
32-
env:
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
with:
35-
tag_name: ${{ github.ref }}
36-
release_name: SPECTRE ${{ steps.get_version.outputs.version }}
37-
draft: true
38-
prerelease: ${{ contains(github.ref, '-') }}
12+
permissions:
13+
contents: write
3914

15+
jobs:
4016
# Build binaries
4117
build:
4218
name: Build (${{ matrix.target }})
43-
needs: create-release
4419
runs-on: ${{ matrix.os }}
4520
strategy:
4621
fail-fast: false
@@ -121,24 +96,10 @@ jobs:
12196
Copy-Item README.md, LICENSE, CHANGELOG.md dist/
12297
Compress-Archive -Path dist/* -DestinationPath "${{ matrix.artifact }}.zip"
12398
124-
- name: Upload Release Asset (Unix)
125-
if: runner.os != 'Windows'
126-
uses: actions/upload-release-asset@v1
127-
env:
128-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
129-
with:
130-
upload_url: ${{ needs.create-release.outputs.upload_url }}
131-
asset_path: ./${{ matrix.artifact }}.tar.gz
132-
asset_name: ${{ matrix.artifact }}.tar.gz
133-
asset_content_type: application/gzip
134-
135-
- name: Upload Release Asset (Windows)
136-
if: runner.os == 'Windows'
137-
uses: actions/upload-release-asset@v1
138-
env:
139-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99+
- name: Upload Release Asset
100+
uses: softprops/action-gh-release@v2
140101
with:
141-
upload_url: ${{ needs.create-release.outputs.upload_url }}
142-
asset_path: ./${{ matrix.artifact }}.zip
143-
asset_name: ${{ matrix.artifact }}.zip
144-
asset_content_type: application/zip
102+
files: |
103+
${{ matrix.artifact }}.tar.gz
104+
${{ matrix.artifact }}.zip
105+
fail_on_unmatched_files: false

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ Session.vim
105105
\#*\#
106106
.\#*
107107

108+
# Visual Studio
109+
*.sln
110+
*.suo
111+
*.user
112+
*.userosscache
113+
*.sln.docstates
114+
108115
# Sublime Text
109116
*.sublime-project
110117
*.sublime-workspace

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
#### Release Workflow Modernization
13+
14+
- **Replaced deprecated GitHub Actions** in `.github/workflows/release.yml`:
15+
- Removed `actions/create-release@v1` (archived/deprecated) and `actions/upload-release-asset@v1` (archived/deprecated)
16+
- Replaced with `softprops/action-gh-release@v2` which auto-detects the tag, uploads assets, and preserves existing release notes
17+
- **Simplified workflow architecture**: Removed the separate `create-release` job — build jobs now upload release assets directly, eliminating the `upload_url` output dependency chain
18+
- **Added `permissions: contents: write`** at the workflow level for `GITHUB_TOKEN` to create releases
19+
- **Unified asset upload step**: Single upload step per build job handles both `.tar.gz` (Unix) and `.zip` (Windows) with `fail_on_unmatched_files: false` so each platform only uploads its own format without failing on the other's missing archive
20+
- **Added `SPECTRE.sln` to `.gitignore`**: Visual Studio solution files (`.sln`, `.suo`, `.user`, etc.) now excluded from version control
21+
1022
### Planned
1123
- GUI application with Tauri 2.0 — Phase 5
1224
- MCP server implementation — Phase 6

0 commit comments

Comments
 (0)