Skip to content
Merged
Changes from 5 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
17 changes: 15 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: Publish

on:
release:
types: [published, edited]
types:
- published
- edited

jobs:
build:
Expand All @@ -14,7 +16,8 @@ jobs:
- name: Checkout the current code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
fetch-depth: 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Optimization! 🚗💨

persist-credentials: true
ref: ${{ github.event.release.tag_name }}

- name: Configure the runtime node
Expand All @@ -31,8 +34,18 @@ jobs:
run: npm run build

- name: Distribute the latest tagged release
id: tag
uses: teunmooij/github-versioned-release@3edf649c6e5e5e976d43f2584b15bdc8b4c8f0df # v1.2.1
with:
template: javascript-action
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Create a branch for tagged release
run: |
git fetch origin "$SHA"
git checkout -b "release/$TAG" "$SHA"
git push origin "release/$TAG"
env:
TAG: ${{ github.event.release.tag_name }}
SHA: ${{ steps.tag.outputs.sha }}