debian build #47
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: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.x | ||
- run: npm ci | ||
- name: Build standalone apps | ||
run: | | ||
npx pkg . -t linux,macos --compress GZip | ||
cd ./dist | ||
cp -f heta-compiler-linux heta-compiler | ||
chmod 775 heta-compiler | ||
tar -czvf ./heta-compiler-linux.tar.gz ./heta-compiler | ||
cp -f heta-compiler-macos heta-compiler | ||
chmod 775 heta-compiler | ||
tar -czvf ./heta-compiler-macos.tar.gz ./heta-compiler | ||
cd .. | ||
-name: Create .deb package | ||
run: | | ||
mkdir -p dist/heta-compiler/DEBIAN | ||
cp build-deb/control dist/heta-compiler/DEBIAN/ | ||
mkdir -p dist/heta-compiler/usr/local/bin | ||
cp dist/heta-compiler-linux dist/heta-compiler/usr/local/bin/ | ||
dpkg-deb --build dist/heta-compiler | ||
- 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 }} | ||
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 }} | ||
asset_path: dist/heta-compiler-macos | ||
asset_name: heta-compiler-macos-x64 | ||
asset_content_type: application/octet-stream | ||
- name: Upload Release TAR.GZ Linux | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: dist/heta-compiler-linux.tar.gz | ||
asset_name: heta-compiler-linux.tar.gz | ||
asset_content_type: application/octet-stream | ||
- name: Upload Release TAR.GZ Macos | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: dist/heta-compiler-macos.tar.gz | ||
asset_name: heta-compiler-macos.tar.gz | ||
asset_content_type: application/octet-stream | ||
- name: Upload Release DEB Linux | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: dist/heta-compiler.deb | ||
asset_name: heta-compiler-linux-x64.deb | ||
asset_content_type: application/octet-stream | ||
upload-windows-release-asset: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.x | ||
- run: npm ci | ||
- name: Build standalone apps | ||
run: | | ||
npx pkg . -t win --compress GZip | ||
cd ./dist | ||
cp -Force heta-compiler.exe heta-compiler-win-x64.exe | ||
tar -czvf ./heta-compiler-windows.tar.gz ./heta-compiler.exe | ||
cd .. | ||
- name: Get package version | ||
id: package_version | ||
run: | # deprecated | ||
$version = node -p "require('./package.json').version" | ||
echo "::set-output name=VERSION::$version" | ||
- name: Install WiX Toolset | ||
run: | | ||
choco install wixtoolset | ||
- name: Generate new GUID | ||
id: new_guid | ||
run: | # deprecated | ||
$guid = [guid]::NewGuid().ToString().ToUpper() | ||
echo "::set-output name=NewGUID::$guid" | ||
- name: Update .wxs file with new Product Id | ||
run: | | ||
echo "GUID: ${{ steps.new_guid.outputs.NewGUID }}" | ||
$pathToWxs = "build-win-installer/perUser.wxs" | ||
$content = Get-Content $pathToWxs -Raw | ||
$newContent1 = $content -replace '(?<=Product\s+Id=")[^"]*', "${{ steps.new_guid.outputs.NewGUID }}" | ||
$newContent2 = $newContent1 -replace '(?<=Version\s*=\s*")0\.0\.0', "${{ steps.package_version.outputs.VERSION }}" | ||
$newContent2 | Set-Content $pathToWxs | ||
- name: Build windows installer | ||
run: | | ||
& ${env:WIX}bin\candle.exe -o dist/ build-win-installer/perUser.wxs | ||
& ${env:WIX}bin\light.exe -o dist/heta-compiler-win-x64-installer.msi dist/perUser.wixobj -ext WixUIExtension | ||
- name: Upload Release Asset Win MSI | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} # part of the GitHub Actions context | ||
asset_path: dist/heta-compiler-win-x64-installer.msi | ||
asset_name: heta-compiler-${{ steps.package_version.outputs.VERSION }}-win-x64-installer.msi | ||
asset_content_type: application/octet-stream | ||
- name: Upload Release TAR.GZ Windows | ||
uses: softprops/action-gh-release@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
files: | | ||
dist/heta-compiler-windows.tar.gz | ||
dist/heta-compiler-win-x64.exe |