Skip to content

Merge pull request #34 from KID-joker/main #17

Merge pull request #34 from KID-joker/main

Merge pull request #34 from KID-joker/main #17

Workflow file for this run

name: Release
permissions:
id-token: write
contents: write
on:
push:
branches:
- release
jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
with:
version: 9.15.0
- uses: actions/setup-node@v4
with:
node-version: lts/*
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: pnpm install
- name: Get version from package.json
id: get_version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Create Git Tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "v${VERSION}" -m "Release v${VERSION}"
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/KID-joker/workflows-demo.git "v${VERSION}"
- name: Build the project
run: pnpm run build
- name: Publish to npm
run: pnpm publish -r --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true