You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there! Thanks for creating and maintaining this.
I recently came across this github action: create-gh-release-action, which parses the CHANGELOG.md file and uses that to create a body for the release.
Might be cool this action supports a similar thing.
- name: Get Changelog Entryid: changelog_readeruses: mindsers/changelog-reader-action@v2with:
validation_depth: 10version: ${{ steps.tag_name.outputs.current_version }}path: ./CHANGELOG.md
- name: Create/update releaseuses: ncipollo/release-action@v1with:
# This pulls from the "Get Changelog Entry" step above, referencing it's ID to get its outputs object.# See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-stepstag: ${{ steps.changelog_reader.outputs.version }}name: Release ${{ steps.changelog_reader.outputs.version }}body: ${{ steps.changelog_reader.outputs.changes }}prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }}allowUpdates: truetoken: ${{ secrets.GITHUB_TOKEN }}
But it would be even better if this was natively supported by this action.
I came across this issue while automating release bodies with a changelog generated from git commits since previous release. Thought I'd share my experience and the resulting workflow.
In my case, I found the tauri-action configuration flexibility sufficient, as there are many compatible changelog-producing actions or tools. If anything, perhaps a suggestion for this issue is a publish-to-auto-release-tag-with-changelog.yml documentation example. tauri-action works great!
For the following workflow, pushed git tags trigger releases while git-cliff generates the changelog for release body from latest (unreleased) commits.
Resulting workflow file
# - remove version from `tauri.conf.json` so it's managed by `Cargo.toml`# - create git-cliff's `cliff.toml` config file with `git cliff --init`name: "publish"on:
push:
tags:
- "v*"# On each push of a `v*` git tag it will create or update a GitHub release with a generated changelog, build your app, and upload the artifacts to the release.jobs:
publish-tauri:
permissions:
contents: writestrategy:
fail-fast: falsematrix:
include:
- platform: "macos-latest"# for Arm based macs (M1 and above).args: "--target aarch64-apple-darwin"
- platform: "macos-latest"# for Intel based macs.args: "--target x86_64-apple-darwin"
- platform: "ubuntu-22.04"# for Tauri v1 you could replace this with ubuntu-20.04.args: ""
- platform: "windows-latest"args: ""runs-on: ${{ matrix.platform }}steps:
- uses: actions/checkout@v4with:
fetch-depth: 0fetch-tags: true
- name: setup nodeuses: actions/setup-node@v4with:
node-version: lts/*
- name: install Rust stableuses: dtolnay/rust-toolchain@stablewith:
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: install dependencies (ubuntu only)if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above.run: | sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf# webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2.# You can remove the one that doesn't apply to your app to speed up the workflow a bit.
- name: install frontend dependenciesrun: npm install # change this to npm, pnpm or bun depending on which one you use.
- name: Extract version from tagrun: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENVshell: bash# for cross-platform build compat, use perl
- name: Update the Tauri App version with tag versionrun: | perl -pi -e 's/^version = ".*"/version = "${{ env.VERSION }}"/' src-tauri/Cargo.toml
- name: install git-cliffrun: cargo install git-cliff || true
- name: generate changelogid: changelogrun: | echo 'changelog<<EOF' >> $GITHUB_OUTPUT git-cliff --latest --strip all --use-branch-tags >> $GITHUB_OUTPUT echo 'EOF' >> $GITHUB_OUTPUT
- uses: tauri-apps/tauri-action@v0env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}with:
tagName: v${{ env.VERSION }}releaseName: v${{ env.VERSION }}releaseBody: "${{ steps.changelog.outputs.changelog }}"releaseDraft: trueprerelease: trueargs: ${{ matrix.args }}
name: "publish"
on:
push:
- branches:- - release+ tags:+ - "v*"
# This is the example from the readme.
# On each push to the `release` branch it will create or update a GitHub release, build your app, and upload the artifacts to the release.
@@ -28,6 +29,9 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
+ with:+ fetch-depth: 0+ fetch-tags: true
- name: setup node
uses: actions/setup-node@v4
@@ -49,15 +53,34 @@ jobs:
# You can remove the one that doesn't apply to your app to speed up the workflow a bit.
- name: install frontend dependencies
run: yarn install # change this to npm, pnpm or bun depending on which one you use.
++ - name: Extract version from tag+ run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV+ shell: bash++ # for cross-platform build compat, use perl+ - name: Update the Tauri App version with tag version+ run: |+ perl -pi -e 's/^version = ".*"/version = "${{ env.VERSION }}"/' src-tauri/Cargo.toml++ - name: install git-cliff+ run: cargo install git-cliff || true++ - name: generate changelog+ id: changelog+ run: |+ echo 'changelog<<EOF' >> $GITHUB_OUTPUT+ git-cliff --latest --strip all --use-branch-tags >> $GITHUB_OUTPUT+ echo 'EOF' >> $GITHUB_OUTPUT
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
- tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.- releaseName: "App v__VERSION__"- releaseBody: "See the assets to download this version and install."+ tagName: v${{ env.VERSION }}+ releaseName: v${{ env.VERSION }}+ releaseBody: "${{ steps.changelog.outputs.changelog }}"
releaseDraft: true
args: ${{ matrix.args }}
Activity
xendarboh commentedon Feb 21, 2025
I came across this issue while automating release bodies with a changelog generated from git commits since previous release. Thought I'd share my experience and the resulting workflow.
In my case, I found the
tauri-actionconfiguration flexibility sufficient, as there are many compatible changelog-producing actions or tools. If anything, perhaps a suggestion for this issue is apublish-to-auto-release-tag-with-changelog.ymldocumentation example.tauri-actionworks great!For the following workflow, pushed git tags trigger releases while git-cliff generates the changelog for release body from latest (unreleased) commits.
Resulting workflow file
Changes to examples/publish-to-auto-release.yml: