Skip to content

Commit

Permalink
feat: add release ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tmkx committed Jul 6, 2024
1 parent 1c01d34 commit 3739770
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ concurrency:

jobs:
test:
name: Test
timeout-minutes: 15
strategy:
matrix:
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Release

on:
workflow_dispatch:
push:
paths:
- '**/CHANGELOG.md'

permissions:
contents: write
pull-requests: write
id-token: write

jobs:
release:
name: Release
runs-on: ubuntu-latest
env:
NPM_CONFIG_PROVENANCE: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/cache@v3
with:
path: .nx
key: nx-${{ runner.os }}-${{ github.sha }}
restore-keys: |
nx-${{ runner.os }}-
- uses: pnpm/action-setup@v3

- uses: actions/setup-node@v4
with:
node-version: 18.x
cache: pnpm

- uses: nrwl/nx-set-shas@v4
# This line is needed for nx affected to work when CI is running on a PR
- name: Fetch NX base
run: |
git fetch --all
- name: Install deps
run: |
pnpm i --frozen-lockfile
- id: prepare
name: Prepare release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
echo "title=chore: $(date +'%Y-%m-%d') release" >> $GITHUB_OUTPUT
- id: changesets
uses: changesets/action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_PROVENANCE: true
with:
commit: ${{ steps.prepare.outputs.title }}
title: ${{ steps.prepare.outputs.title }}
publish: pnpm -w changeset publish

0 comments on commit 3739770

Please sign in to comment.