On release #19
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: On release | |
on: | |
release: | |
types: [created] | |
jobs: | |
upload-release-asset: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
- run: npm ci | |
- name: Get package version | |
id: package_version | |
shell: bash | |
run: | | |
echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV | |
echo "$VERSION" | |
echo "${{ env.VERSION }}" | |
- name: Build standalone apps | |
run: npm run pkg | |
- name: Install WiX Toolset | |
run: | | |
choco install wixtoolset | |
- name: Generate new GUID | |
id: new_guid | |
run: | | |
$guid = [guid]::NewGuid().ToString().ToUpper() | |
echo "NewGUID=$guid" >> $GITHUB_OUTPUT | |
- name: Update .wxs file with new Product Id | |
run: | | |
$pathToWxs = "build-win-installer.wxs" | |
$content = Get-Content $pathToWxs -Raw | |
$newContent = $content -replace '(?<=Product\s+Id=")[^"]*', "${{ steps.new_guid.outputs.NewGUID }}" | |
# $newContent | Set-Content $pathToWxs | |
- name: Build windows installer | |
run: | | |
& ${env:WIX}bin\candle.exe -o dist\ build-win-installer.wxs | |
& ${env:WIX}bin\light.exe -o dist\heta-compiler-win-x64-installer.msi dist\build-win-installer.wixobj | |
- name: Upload Release Asset Win | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} # This is part of the GitHub Actions context | |
asset_path: dist/heta-compiler-win-x64-installer.msi | |
asset_name: heta-compiler-win-x64-${{ env.VERSION }}-installer.msi | |
asset_content_type: application/octet-stream | |
- name: Upload Release Asset Win | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} # This is part of the GitHub Actions context | |
asset_path: dist/heta-compiler-win.exe | |
asset_name: heta-compiler-win-x64.exe | |
asset_content_type: application/octet-stream | |
- name: Upload Release Asset Linux | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} # This is part of the GitHub Actions context | |
asset_path: dist/heta-compiler-linux | |
asset_name: heta-compiler-linux-x64 | |
asset_content_type: application/octet-stream | |
- name: Upload Release Asset Macos | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} # This is part of the GitHub Actions context | |
asset_path: dist/heta-compiler-macos | |
asset_name: heta-compiler-macos-x64 | |
asset_content_type: application/octet-stream |