Update release.yml #7
Workflow file for this run
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 and Release | |
on: | |
push: | |
tags: | |
- 'v*.*.*' # This triggers the workflow on version tags | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- uses: pnpm/[email protected] | |
with: | |
version: 8.6.1 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '21.x' | |
- name: Install dependencies | |
run: pnpm install | |
working-directory: web | |
- name: Build Svelte project | |
run: pnpm run build | |
working-directory: web | |
- name: Bundle files | |
run: | | |
mkdir -p ./temp/mm_radio | |
mkdir -p ./temp/mm_radio/build/ | |
cp ./{LICENSE,README.md,battery.json,fxmanifest.lua} ./temp/mm_radio | |
cp -r ./{client,server,shared,locales} ./temp/mm_radio | |
cp -r ./build ./temp/mm_radio/build/ | |
cd ./temp && zip -r ../mm_radio.zip ./mm_radio | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} # Use the tag name as the release title | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./mm_radio.zip # Path to the zip file | |
asset_name: mm_radio.zip # Name of the asset | |
asset_content_type: application/zip |