mirror of
https://github.com/elladunbar/tree-sitter-zanscript.git
synced 2025-11-05 15:19:55 -06:00
Create workflow to release zip file
This commit is contained in:
parent
441e83b732
commit
ceefc6d30c
1 changed files with 66 additions and 0 deletions
66
.github/workflows/release.yml
vendored
Normal file
66
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
name: Build and Release Tree-sitter Grammar
|
||||||
|
|
||||||
|
# Trigger on push to main branch or manually
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch: # Allows manual triggering of the workflow
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: '22' # or the version you need
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm install
|
||||||
|
|
||||||
|
- name: Run build step
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Create an archive of the repository with build artifacts
|
||||||
|
run: |
|
||||||
|
zip -r release.zip ./*
|
||||||
|
|
||||||
|
- name: Upload release zip as an artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: tree-sitter-grammar-release
|
||||||
|
path: release.zip
|
||||||
|
|
||||||
|
release:
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Download the artifact
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: tree-sitter-grammar-release
|
||||||
|
|
||||||
|
- name: Create GitHub Release
|
||||||
|
id: create_release
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: v${{ github.run_number }}
|
||||||
|
release_name: Release v${{ github.run_number }}
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
||||||
|
|
||||||
|
- name: Upload zip file to GitHub release
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./tree-sitter-grammar-release.zip
|
||||||
|
asset_name: tree-sitter-grammar-release.zip
|
||||||
|
asset_content_type: application/zip
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue