Skip to content

Merge pull request #169 from JairusSW/dependabot/github_actions/oven-… #3

Merge pull request #169 from JairusSW/dependabot/github_actions/oven-…

Merge pull request #169 from JairusSW/dependabot/github_actions/oven-… #3

Workflow file for this run

name: Release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
packages: write
jobs:
# Run tests before release
test:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v6
- name: Install Wasmtime
run: |
curl https://wasmtime.dev/install.sh -sSf | bash
echo "$HOME/.wasmtime/bin" >> $GITHUB_PATH
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install Dependencies
run: bun install
- name: TypeScript Type Check
run: bun run typecheck
- name: Lint
run: bun run lint
- name: Build Transform
run: bun run build:transform
- name: Run Tests
run: bash ./run-tests.sh
# Create GitHub Release
release:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout the repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install Dependencies
run: bun install
- name: Build Transform
run: bun run build:transform
- name: Generate Release Notes
id: changelog
run: |
# Get the previous tag
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
if [ -z "$PREV_TAG" ]; then
# First release - get all commits
COMMITS=$(git log --pretty=format:"- %s (%h)" --no-merges)
else
# Get commits since last tag
COMMITS=$(git log ${PREV_TAG}..HEAD --pretty=format:"- %s (%h)" --no-merges)
fi
# Write to file for the release
echo "## Changes" > RELEASE_NOTES.md
echo "" >> RELEASE_NOTES.md
echo "$COMMITS" >> RELEASE_NOTES.md
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
body_path: RELEASE_NOTES.md
draft: false
prerelease: ${{ contains(github.ref, '-alpha') || contains(github.ref, '-beta') || contains(github.ref, '-rc') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Publish to npm
publish-npm:
runs-on: ubuntu-latest
needs: release
steps:
- name: Checkout the repository
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
- name: Install Dependencies
run: npm install
- name: Build Transform
run: npm run build:transform
- name: Publish to npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# Publish to GitHub Packages
publish-gpr:
runs-on: ubuntu-latest
needs: release
steps:
- name: Checkout the repository
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "20"
registry-url: "https://npm.pkg.github.com"
- name: Install Dependencies
run: npm install
- name: Build Transform
run: npm run build:transform
- name: Publish to GitHub Packages
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}