tree-sitter/.github/workflows/release.yml
dependabot[bot] 790dcc115f ci: bump the actions group with 2 updates
Bumps the actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [actions/download-artifact](https://github.com/actions/download-artifact).


Updates `actions/checkout` from 4 to 5
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

Updates `actions/download-artifact` from 4 to 5
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/download-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-13 12:35:25 +02:00

109 lines
2.7 KiB
YAML

name: Release
on:
workflow_dispatch:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
jobs:
build:
uses: ./.github/workflows/build.yml
with:
run-test: false
release:
name: Release on GitHub
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Download build artifacts
uses: actions/download-artifact@v5
with:
path: artifacts
- name: Display structure of downloaded files
run: ls -lR
working-directory: artifacts
- name: Prepare release artifacts
run: |
mkdir -p target web
mv artifacts/tree-sitter.wasm/* web/
tar -czf target/web-tree-sitter.tar.gz -C web .
rm -r artifacts/tree-sitter.wasm
for platform in $(cd artifacts; ls | sed 's/^tree-sitter\.//'); do
exe=$(ls artifacts/tree-sitter.$platform/tree-sitter*)
gzip --stdout --name $exe > target/tree-sitter-$platform.gz
done
rm -rf artifacts
ls -l target/
- name: Create release
run: |-
gh release create ${{ github.ref_name }} \
target/tree-sitter-*.gz \
target/web-tree-sitter.tar.gz
env:
GH_TOKEN: ${{ github.token }}
crates_io:
name: Publish packages to Crates.io
runs-on: ubuntu-latest
needs: release
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Publish crates to Crates.io
uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
npm:
name: Publish packages to npmjs.com
runs-on: ubuntu-latest
needs: release
strategy:
fail-fast: false
matrix:
directory: [cli/npm, lib/binding_web]
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Build wasm
if: matrix.directory == 'lib/binding_web'
run: |
cd ${{ matrix.directory }}
npm ci
npm run build
npm run build:debug
CJS=true npm run build
CJS=true npm run build:debug
- name: Publish to npmjs.com
working-directory: ${{ matrix.directory }}
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}