Skip to content

Commit

Permalink
chore: set canary workflow (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zizzamia authored Mar 12, 2024
1 parent 811e198 commit 1f18656
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release (Canary)
on:
workflow_dispatch:

jobs:
canary:
name: Release canary
runs-on: ubuntu-latest
environment: release
permissions:
contents: write
pull-requests: write
id-token: write
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: 'Setup'
uses: ./.github/actions/setup

- name: Set version
run: |
cd src
npm --no-git-tag-version version $(npm pkg get version | sed 's/"//g')-$(git branch --show-current | tr -cs '[:alnum:]-' '-' | tr '[:upper:]' '[:lower:]' | sed 's/-$//').$(date +'%Y%m%dT%H%M%S')
- name: Build
shell: bash
run: yarn build

- name: Set deployment token
run: npm config set '//registry.npmjs.org/:_authToken' "${{ secrets.NPM_TOKEN }}"

- name: Publish to npm
run: |
cd src
npm publish --tag $(git branch --show-current | tr -cs '[:alnum:]-' '-' | tr '[:upper:]' '[:lower:]' | sed 's/-$//')
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Binary file modified site/.yarn/install-state.gz
Binary file not shown.

0 comments on commit 1f18656

Please sign in to comment.