Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: only run release when tags pushed #2388

Merged
merged 4 commits into from
Jan 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 4 additions & 5 deletions .github/workflows/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ description: 'Set up and install dependencies'

inputs:
fetch-depth:
description: 'Number of commits to fetch'
default: '1'
required: false
persist-credentials:
default: true
description: 'Whether to persist credentials'
default: "true"
required: false


Expand All @@ -17,7 +19,7 @@ runs:
uses: actions/checkout@v3

- name: Setup pnpm
uses: pnpm/action-setup@v2.2.2
uses: pnpm/action-setup@v2.2.4

- name: Use Node.js 16
uses: actions/setup-node@v3
Expand All @@ -27,9 +29,6 @@ runs:

- name: Install Dependencies
shell: bash

run: |
corepack enable
pnpm install
env:
CI: true
9 changes: 4 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:

jobs:
release:
if: ${{ contains('refs/tags', github.ref) == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Check out
Expand All @@ -19,9 +20,7 @@ jobs:
- name: Install
uses: ./.github/workflows/install

- name: Publish
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
npm publish --access public
- name: Release
run: pnpm publish --access public --no-git-checks
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
pull_request:


jobs:
test:
Expand All @@ -22,5 +23,3 @@ jobs:
pnpm clean
pnpm build
pnpm test-packaging
env:
CI: true