build: fix #87
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: Build | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Setup Deno | |
uses: denoland/setup-deno@v2 | |
with: | |
deno-version: v2.x | |
- name: Install dependencies | |
run: deno install --frozen | |
- name: Lint | |
run: deno lint | |
- name: Test | |
id: test | |
run: deno task test | |
- name: JSR dry-run publish | |
run: deno publish --dry-run --allow-dirty | |
- name: Build NPM packages | |
run: deno task npm | |
- name: Upload failed verify outputs | |
if: always() && (steps.test.outcome == 'failure') | |
uses: actions/upload-artifact@v4 | |
with: | |
name: verify-outputs | |
path: packages/**/.verify/**/* | |
if-no-files-found: ignore | |
- name: Upload NPM packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: npm | |
path: npm | |
publish: | |
name: Publish | |
needs: build | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
if: github.ref == 'refs/heads/main' | |
permissions: | |
contents: write | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Deno | |
uses: denoland/setup-deno@v2 | |
with: | |
deno-version: v2.x | |
- name: Download NPM packages | |
uses: actions/download-artifact@v4 | |
with: | |
name: npm | |
path: npm | |
- name: Publish @goast/core to JSR | |
run: deno publish | |
working-directory: packages/core | |
- name: Publish @goast/core to NPM | |
id: publish-core | |
uses: JS-DevTools/npm-publish@v3 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
package: npm/@goast/core | |
- name: Create Tag for @goast/core | |
uses: rickstaa/action-create-tag@v1 | |
with: | |
tag: core/v${{ steps.publish-core.outputs.version }} | |
tag_exists_error: false | |
- name: Publish @goast/kotlin to JSR | |
run: deno publish | |
working-directory: packages/kotlin | |
- name: Publish @goast/kotlin to NPM | |
id: publish-kotlin | |
uses: JS-DevTools/npm-publish@v3 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
package: npm/@goast/kotlin | |
- name: Create Tag for @goast/kotlin | |
uses: rickstaa/action-create-tag@v1 | |
with: | |
tag: kotlin/v${{ steps.publish-kotlin.outputs.version }} | |
tag_exists_error: false | |
- name: Publish @goast/typescript to JSR | |
run: deno publish | |
working-directory: packages/typescript | |
- name: Publish @goast/typescript to NPM | |
id: publish-typescript | |
uses: JS-DevTools/npm-publish@v3 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
package: npm/@goast/typescript | |
- name: Create Tag for @goast/typescript | |
uses: rickstaa/action-create-tag@v1 | |
with: | |
tag: typescript/v${{ steps.publish-typescript.outputs.version }} | |
tag_exists_error: false |