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

Fix publish.yml #270

Merged
merged 2 commits into from
Oct 31, 2023
Merged
Changes from all commits
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
37 changes: 19 additions & 18 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,32 @@ name: Publish
on:
push:
tags:
- '*'
- 'v*'
# Manual run
workflow_dispatch:
inputs:
tag:
required: true
type: string
description: 'Tag to release'

jobs:
publish:
name: Publish to npm
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
release:
name: release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: volta-cli/action@v4
steps:
- uses: actions/checkout@v4
with:
node-version: 16.x
registry-url: 'https://registry.npmjs.org'

- name: Install Dependencies
run: yarn install --frozen-lockfile
ref: ${{ github.event.inputs.tag || github.ref_name }}

- name: auto-dist-tag
run: npx auto-dist-tag --write
- uses: wyvox/action-setup-pnpm@v3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this set registry-url? Otherwise publishing will not work

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not by default, no. Just added.

Should specifying a registry-url be default? any downsides to that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't typically do it by default, it changes whether setup-node stores credentials or not

with:
registry-url: 'https://registry.npmjs.org'
- run: npx auto-dist-tag --write
working-directory: './addon/'

- name: publish to npm
run: npm publish
- run: pnpm publish
working-directory: './addon/'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
working-directory: './addon/'