Skip to content

Commit

Permalink
Merge pull request #33 from KID-joker/ci-release
Browse files Browse the repository at this point in the history
ci: release
  • Loading branch information
KID-joker authored Dec 23, 2024
2 parents 2241160 + 8ffe754 commit 52396b1
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/automated-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Automated 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: Build the project
run: pnpm run build

- name: Publish to npm
run: pnpm publish -r --access public --publish-branch release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true

- 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/npm-deprecated-check.git "v${VERSION}"

0 comments on commit 52396b1

Please sign in to comment.