💥🎨Simplified UIStore
#30
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: CI | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "*" | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
outputs: | |
should_run: ${{ steps.set_condition.outputs.should_run }} | |
steps: | |
- id: set_condition | |
run: | | |
if [[ "${{ github.ref_type }}" == "tag" ]] || [[ "${{ contains(github.event.head_commit.message, '📦️') }}" == "false" ]]; then | |
echo "should_run=true" >> $GITHUB_OUTPUT | |
else | |
echo "should_run=false" >> $GITHUB_OUTPUT | |
fi | |
check: | |
runs-on: ubuntu-latest | |
needs: setup | |
if: ${{ startsWith(github.ref, 'refs/tags/') || needs.setup.outputs.should_run == 'true' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: denoland/setup-deno@v2 | |
with: | |
deno-version: v2.x | |
- name: Run checks | |
run: deno task check | |
publish-jsr: | |
runs-on: ubuntu-latest | |
needs: check | |
if: "${{ startsWith(github.ref, 'refs/tags/') }}" | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Publish jsr | |
run: npx jsr publish | |
publish-npm: | |
runs-on: ubuntu-latest | |
needs: check | |
if: "${{ startsWith(github.ref, 'refs/tags/') }}" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: denoland/setup-deno@v2 | |
with: | |
deno-version: v2.x | |
- name: Build npm packages | |
run: deno task build | |
- name: Setup Node/npm | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
registry-url: "https://registry.npmjs.org" | |
scope: "@carefree0910" | |
- name: Publish to npm | |
run: deno task publish:npm | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |