forked from mirror/codesnap.nvim
80 lines
1.9 KiB
YAML
80 lines
1.9 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
project.toml
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
pack:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup nodejs
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
cache-dependency-path: ./snap-client/package-lock.json
|
|
|
|
- name: Install deps
|
|
working-directory: snap-client
|
|
run: npm i
|
|
|
|
- name: Build package
|
|
working-directory: snap-client
|
|
run: npm run build
|
|
|
|
- name: Move into public folder
|
|
run: cp -r snap-client/build snap-server/public
|
|
|
|
- name: Commit changes
|
|
uses: EndBug/add-and-commit@v9
|
|
with:
|
|
message: "[Update] build newest client package"
|
|
|
|
release:
|
|
needs: pack
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
- name: Replace template
|
|
run: python3 scripts/replace-template.py
|
|
|
|
- name: Commit changes
|
|
uses: EndBug/add-and-commit@v9
|
|
with:
|
|
message: "[Update] apply template"
|
|
|
|
- name: Read version from project config
|
|
id: read_toml
|
|
uses: SebRollen/toml-action@v1.0.2
|
|
with:
|
|
file: project.toml
|
|
field: project.version
|
|
|
|
- name: Bump version and push tag
|
|
id: tag_version
|
|
uses: mathieudutour/github-tag-action@v6.1
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
custom_tag: ${{ steps.read_toml.outputs.value }}
|
|
|
|
- name: Create a GitHub release
|
|
uses: ncipollo/release-action@v1
|
|
with:
|
|
tag: ${{ steps.tag_version.outputs.new_tag }}
|
|
name: Release ${{ steps.tag_version.outputs.new_tag }}
|
|
generateReleaseNotes: true
|