Skip to content

Build and Release

Build and Release #12

Workflow file for this run

name: Build and Release
on:
workflow_dispatch:
jobs:
build_and_release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Build
run: |
npm run build
cp -r dist DwarfStellariumGoto
echo "python3 -m http.server" > DwarfStellariumGoto/start_server.bat
- name: Zip DwarfStellariumGoto
run: zip -r DwarfStellariumGoto.zip DwarfStellariumGoto
- name: Get version number from package.json
id: get_version
run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')"
- name: Create artifact DwarfStellariumGoto
uses: actions/upload-artifact@v3
with:
name: DwarfStellariumGoto-${{ steps.get_version.outputs.version }}
path: DwarfStellariumGoto.zip
- name: Install Rust and Cargo
run: sudo apt update && sudo apt-get install rustc cargo libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf -y
- name: Run Tauri build
run: npm run tauri build
- name: Create MSI artifact
uses: actions/upload-artifact@v3
with:
name: DwarfStellariumGoto-MSI-${{ steps.get_version.outputs.version }}
path: src-tauri/target/release/bundle/msi/
- name: Release with ncipollo/release-action
id: release
uses: ncipollo/release-action@v1
with:
artifacts: |
DwarfStellariumGoto.zip
src-tauri/target/release/bundle/msi/
token: ${{ secrets.GITHUB_TOKEN }}
generateReleaseNotes: true
skipIfReleaseExists: true
tag: v${{ steps.get_version.outputs.version }}