v1.6.0 #19
Workflow file for this run
This file contains 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: Publish Release | |
on: | |
release: | |
types: [published] | |
jobs: | |
release: | |
name: Publish Release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: read | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.ROBUDDYBOT_PAT }} | |
- uses: pnpm/action-setup@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: "pnpm" | |
cache-dependency-path: "./pnpm-lock.yaml" | |
- name: Install dependencies | |
run: pnpm install | |
- name: Extract version from tag | |
id: extract_version | |
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
# Updates the version in the package.json | |
- name: Set package version | |
uses: ZeWaka/set-node-package-version@v1 | |
with: | |
version: ${{ steps.extract_version.outputs.version }} | |
- name: Build project | |
run: pnpm build | |
- name: Commit changes | |
run: | | |
git config --global user.name "robuddybot" | |
git config --global user.email "[email protected]" | |
git add . | |
git commit -m "Build & Release ${{ github.event.release.tag_name }}" || echo "No changes to commit" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.ROBUDDYBOT_PAT }} | |
- name: Get new Git SHA | |
id: get_sha | |
run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
- name: Update tag to latest commit | |
run: | | |
git tag -f ${{ github.event.release.tag_name }} ${{ steps.get_sha.outputs.sha }} | |
git push origin ${{ github.event.release.tag_name }} --force | |
- name: Build Changelog | |
id: build_changelog | |
uses: mikepenz/release-changelog-builder-action@v4 | |
- name: Update Release | |
uses: tubone24/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
TAG_NAME: ${{ github.event.release.tag_name }} | |
with: | |
release_name: ${{ github.event.release.tag_name }} | |
body: ${{steps.build_changelog.outputs.changelog}} | |
draft: false | |
- uses: JS-DevTools/npm-publish@v3 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} |