Skip to content
Merged
Changes from all 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
22 changes: 17 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.WORKFLOW_PAT }}
persist-credentials: false

- name: Setup Node
uses: actions/setup-node@v4
Expand All @@ -53,23 +55,33 @@ jobs:
fi
echo "resolved=$RELEASE_VERSION" >> "$GITHUB_OUTPUT"

- name: Bump versions and commit
- name: Resolve version
env:
INPUT_VERSION: ${{ steps.resolve_version.outputs.resolved }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
node ./scripts/release/version.js "$INPUT_VERSION"
RESOLVED_VERSION=$(jq -r .version package.json)
git commit -am "chore: release v$RESOLVED_VERSION"
git push origin HEAD
echo "RESOLVED_VERSION=$RESOLVED_VERSION" >> "$GITHUB_ENV"

- name: Set git identity (Actions bot)
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should that email be a secret as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so, this is generic github actions bot email


- name: Commit & push
uses: actions-js/push@v1.4
with:
github_token: ${{ secrets.WORKFLOW_PAT }}
branch: ${{ github.ref_name }}
message: 'chore: release v${{ env.RESOLVED_VERSION }}'

- name: Build
run: yarn build

- name: Tag and create GitHub release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION=$(jq -r .version package.json)
git tag -a "v$VERSION" -m "Release v$VERSION"
Expand Down