This repository has been archived by the owner on Oct 30, 2024. It is now read-only.
Merge branch 'main' into dev #67
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Push alpha artifact to npm | |
on: | |
push: | |
branches: | |
- dev | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
version: 9 | |
run_install: false | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build | |
run: pnpm run build | |
- name: Publish alpha | |
run: | | |
git config --global user.name "Matilde Park" | |
git config --global user.email "matilde.park@hdr.is" | |
git_hash=$(git rev-parse --short "$GITHUB_SHA") | |
echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" > ~/.npmrc | |
pnpm version prerelease --preid alpha.$git_hash --no-git-tag-version | |
pnpm publish --tag alpha --no-git-checks | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |