Merge pull request #54 from taroj1205/changeset-release/main #31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
paths: | |
- "CHANGELOG.md" | |
branches: | |
- main | |
jobs: | |
release: | |
permissions: | |
contents: write | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [windows-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install dependencies (Windows only) | |
if: matrix.platform == 'windows-latest' | |
run: | | |
npm install -g pnpm | |
pnpm install | |
- name: Build the app | |
run: pnpm tauri build | |
- name: Get Changelog Entry | |
id: get-changelog | |
run: | | |
CHANGELOG_CONTENT=$(awk '/^## / {count++} count==1 {print} count>1 {exit}' CHANGELOG.md | sed '1d') | |
echo "changelog<<EOF" >> $GITHUB_OUTPUT | |
echo "$CHANGELOG_CONTENT" >> $GITHUB_OUTPUT | |
echo "EOF" >> $GITHUB_OUTPUT | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
src-tauri/target/release/bundle/msi/*.msi | |
src-tauri/target/release/bundle/nsis/*.exe | |
src-tauri/target/release/Clippr.exe | |
body: ${{ steps.get-changelog.outputs.changelog }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |