Skip to content

Update release.yml

Update release.yml #3

Workflow file for this run

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
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '21.1.0' # Using Node.js version 21.1.0
- name: Install dependencies
run: npm install --prefix web # Install dependencies in the web folder
- name: Build Svelte project
run: npm run build --prefix web # Run build script in the web folder
- name: Move build output to mm_radio folder
run: mv web/public mm_radio # Move the build output to mm_radio folder
- name: Zip the mm_radio folder
run: zip -r mm_radio.zip mm_radio # Zip the entire mm_radio folder
- 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