Skip to content

Build Installer

Build Installer #27

name: Build Installer
on:
workflow_dispatch:
jobs:
build:
permissions: write-all
name: Build Installer
runs-on: windows-latest # Run script on windows system
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20' # Use NodeJs 20
- name: Install Dependencies
working-directory: millennium.installer
run: npm install # Install dependecies in package.json
- name: Compile and Build Installer
working-directory: millennium.installer
run: npm run build # Run the build script in package.json
- name: Calculate Artifact Hash
id: calculate-hash
run: |
echo "::set-output name=hash::$(sha256sum millennium.installer/build/output/Millennium.Installer-Windows.exe | cut -d ' ' -f 1)"
- name: Create Checksum File
run: |
echo "${{ steps.calculate-hash.outputs.hash }}" > checksum.sha256
working-directory: millennium.installer/build/output/
- name: Create Release Draft
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: 1.0.0 # You can specify your version here
release_name: Millennium.Installer v1.0.0 # You can specify your release name here
draft: true
prerelease: false # Change to true if it's a pre-release
body: |
This is a draft release for the Millennium Installer.
Please review and provide feedback.
- name: Upload Installer Executable
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: millennium.installer/build/output/Millennium.Installer-Windows.exe
asset_name: Millennium.Installer-Windows.exe
asset_content_type: application/octet-stream
- name: Upload Checksum File
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: millennium.installer/build/output/checksum.sha256
asset_name: checksum.sha256
asset_content_type: text/plain