This repository has been archived by the owner on Aug 16, 2024. It is now read-only.
Build Installer #1
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 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 | |
run: npm install # Install dependecies in package.json | |
- name: Compile and Build 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 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: 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: 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: build/output/checksum.sha256 | |
asset_name: checksum.sha256 | |
asset_content_type: text/plain |