Skip to content

fix(release): use yarn auth instead of npm #23

fix(release): use yarn auth instead of npm

fix(release): use yarn auth instead of npm #23

Workflow file for this run

name: release
on:
push:
branches:
- main
workflow_dispatch: {}
jobs:
release:
runs-on: ubuntu-latest
defaults:
run:
shell: nix develop --command bash {0}
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: DeterminateSystems/flake-checker-action@main
- name: Install dependencies
run: |
yarn install --immutable
- name: Build
run: |
yarn tsc
yarn build
- name: Configure yarn for publishing
run: |
yarn config set -H 'npmAuthToken' "${{secrets.NPM_AUTH_TOKEN}}"
# yarn config set -H 'npmRegistries["//npm.pkg.github.com"].npmAuthToken' "${{secrets.GITHUB_TOKEN}}"
- name: Release to GitHub releases
run: errout=$(mktemp); gh release create $(cat package.json | jq -r .version) -R $GITHUB_REPOSITORY -t $(cat package.json | jq -r .version) --target $GITHUB_REF 2> $errout && true; exitcode=$?; if [ $exitcode -ne 0 ] && ! grep -q "Release.tag_name already exists" $errout; then cat $errout; exit $exitcode; fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_REF: ${{ github.ref }}
- name: Release to NPM
run: yarn npm publish --access public