deps: Update dependencies (#357) #16
Workflow file for this run
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: | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
release: | |
permissions: | |
contents: write | |
pull-requests: write | |
id-token: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.ref_name }} | |
- name: Get variables | |
id: version | |
run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}" | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22.6.0' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install dependencies | |
run: npm install | |
- name: Update package.json version | |
run: npm version ${{ steps.version.outputs.version }} --no-git-tag-version --allow-same-version | |
- name: Commit package.json | |
run: | | |
if [[ `git status --porcelain` ]]; then | |
git config user.email "dev.yakuza@gmail.com" | |
git config user.name "dev-yakuza" | |
git add . | |
git commit -m "chore: Release v${{ steps.version.outputs.version }}" | |
git push origin HEAD:main -f | |
git tag ${{ steps.version.outputs.version }} -f | |
git push origin ${{ steps.version.outputs.version }} -f | |
fi | |
- run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
# For release notes | |
- uses: release-drafter/release-drafter@v6 | |
with: | |
tag: ${{ steps.version.outputs.version }} | |
name: ${{ steps.version.outputs.version }} | |
version: ${{ steps.version.outputs.version }} | |
publish: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |