Stable Release #67
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
# Release a stable version of icestudio | |
# 1. The binaries are generated for all the platforms | |
# 2. A new release is created | |
# 3. The binaries are uploaded to the Release page | |
name: Stable Release | |
# Manual activation | |
on: [workflow_dispatch] | |
jobs: | |
#-- Build for Linux and windows | |
build-LinWin: | |
runs-on: ubuntu-22.04 | |
outputs: | |
#-- URL to upload the binaries for | |
#-- the jobs executed after build-LinWin | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
# Debug: It is for testing if the `certificate has expired` | |
# Error is solved | |
- name: 'Debug: No SSL verification' | |
run: | | |
git config --global http.sslVerify false | |
# Checkout the master repo branch | |
- name: Checkout! | |
uses: actions/checkout@v3 | |
with: | |
ref: master | |
# jq is bash command for reading properties from a json file | |
- name: Install jq package | |
run: sudo apt install jq | |
# Read the icestudio version from package.json (version property) | |
- name: Read the package.json file | |
id: icestudio_json | |
run: | | |
version=$(jq -r '.version' package.json) | |
echo "icestudio_version=${version}" >> $GITHUB_OUTPUT | |
echo $version | |
# -- Debug: Print the icestudio version | |
- name: Get the Icestudio version | |
env: | |
VERSION: "${{steps.icestudio_json.outputs.icestudio_version}}" | |
run: | | |
echo "VERSION: ${{ env.VERSION }}" | |
# Install Node | |
- name: Setup Nodejs version | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.1.0' | |
- name: Install npm dependencies | |
run: | | |
npm install --legacy-peer-deps | |
# It is necesarry to install wine for building the package for | |
# windows. Also it is necesary to download the wine-mono windows | |
# installer and install it with wine | |
- name: Install dependencies | |
run: | | |
sudo add-apt-repository universe | |
sudo dpkg --add-architecture i386 | |
sudo apt-get update | |
sudo apt-get install wine nsis | |
wget https://dl.winehq.org/wine/wine-mono/5.0.0/wine-mono-5.0.0-x86.msi | |
export DISPLAY=:0.0 | |
wine msiexec /i wine-mono-5.0.0-x86.msi | |
# -- Build For windows!! | |
- name: Build Microsoft Windows package | |
run: | | |
export DISPLAY=:0.0 | |
npm run buildWindows | |
echo "====> DEBUG: Contents of the dist folder..." | |
ls -l dist | |
#-- Create the Release (draft) | |
- name: Create the Stable Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
VERSION: "${{steps.icestudio_json.outputs.icestudio_version}}" | |
with: | |
tag_name: v${{ env.VERSION }} | |
release_name: v${{ env.VERSION }} | |
body: | | |
A new stable release | |
draft: true | |
prerelease: false | |
# --------------------------------------- | |
# -- Upload the Windows binaries to the release | |
# --------------------------------------- | |
- name: 'Upload MSI/win64' | |
uses: actions/upload-release-asset@v1 | |
env: | |
VERSION: "${{steps.icestudio_json.outputs.icestudio_version}}" | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_name: "icestudio-${{env.VERSION}}-win64.exe" | |
asset_path: "dist/icestudio-${{env.VERSION}}-win64.exe" | |
asset_content_type: application/tar+gzip | |
- name: 'Upload ZIP/win64' | |
uses: actions/upload-release-asset@v1 | |
env: | |
VERSION: "${{steps.icestudio_json.outputs.icestudio_version}}" | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_name: "icestudio-${{env.VERSION}}-win64.zip" | |
asset_path: "dist/icestudio-${{env.VERSION}}-win64.zip" | |
asset_content_type: application/tar+gzip | |
#-- Build for linux | |
- name: Build Linux | |
run: | | |
export DISPLAY=:0.0 | |
npm run buildLinux64 | |
echo "====> DEBUG: Contents of the dist folder..." | |
ls -l dist | |
# --------------------------------------- | |
# -- Upload the Linux binaries to the release | |
# --------------------------------------- | |
- name: 'Upload AppImage/linux64' | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
VERSION: "${{steps.icestudio_json.outputs.icestudio_version}}" | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: "dist/icestudio-${{env.VERSION}}-linux64.AppImage" | |
asset_name: "icestudio-${{env.VERSION}}-linux64.AppImage" | |
asset_content_type: application/tar+gzip | |
- name: 'Upload ZIP/linux64' | |
uses: actions/upload-release-asset@v1 | |
env: | |
VERSION: "${{steps.icestudio_json.outputs.icestudio_version}}" | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_name: "icestudio-${{env.VERSION}}-linux64.zip" | |
asset_path: "dist/icestudio-${{env.VERSION}}-linux64.zip" | |
asset_content_type: application/tar+gzip | |
# Build for macos | |
build-macos: | |
# -- It is only run if the build for linux/win is ok, and | |
# -- the release was already created | |
needs: build-LinWin | |
runs-on: macOS-latest | |
steps: | |
- name: Checkout the master repo branch | |
uses: actions/checkout@v3 | |
with: | |
ref: master | |
- name: Setup Nodejs version | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.1.0' | |
- name: Install npm dependencies | |
run: npm install --legacy-peer-deps | |
- name: Build OSX packages | |
run: | | |
npm run buildOSX | |
ls dist/ | |
# Loading vars from icestudio package.json | |
- id: icestudio_json | |
run: | | |
content=`tr '\n' ' ' < package.json` | |
echo "packageJson=${content}" >> $GITHUB_OUTPUT | |
# Upload the binaries to the release | |
- name: 'Upload DMG/OSX64' | |
uses: actions/upload-release-asset@v1 | |
env: | |
VERSION: "${{fromJson(steps.icestudio_json.outputs.packageJson).version}}" | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
# -- The upload url is read from the previous job: build-LinWin | |
upload_url: ${{ needs.build-LinWin.outputs.upload_url }} | |
asset_name: "icestudio-${{env.VERSION}}-osx64.dmg" | |
asset_path: "dist/icestudio-${{env.VERSION}}-osx64.dmg" | |
asset_content_type: application/tar+gzip | |
- name: 'Upload ZIP/OSX64' | |
uses: actions/upload-release-asset@v1 | |
env: | |
VERSION: "${{steps.icestudio_json.outputs.icestudio_version}}" | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.build-LinWin.outputs.upload_url }} | |
asset_name: "icestudio-${{env.VERSION}}-osx64.zip" | |
asset_path: "dist/icestudio-${{env.VERSION}}-osx64.zip" | |
asset_content_type: application/tar+gzip | |
# Build for ARM 64 | |
build-arm: | |
# -- It is only run if the build for linux/win is ok, and | |
# -- the release already created | |
needs: build-LinWin | |
# The type of runner that the job will run on | |
runs-on: ubuntu-22.04 | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checkout the develop branch | |
- uses: actions/checkout@v3 | |
with: | |
ref: master | |
#-- PATCH! For ARM use NWjs 0.60 | |
- name: Setup por arm64 | |
run: ./scripts/preInstallArm64.sh | |
- name: Setup Nodejs version | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '19.3.0' | |
- name: Install npm dependencies | |
run: npm install --legacy-peer-deps | |
- name: Build ARM | |
run: | | |
export DISPLAY=:0.0 | |
npm run buildAarch64 | |
echo "====> DEBUG: Contents of the dist folder..." | |
ls -l dist | |
# jq is bash command for reading properties from a json file | |
- name: Install jq package | |
run: sudo apt install jq | |
# Read the icestudio version from package.json (version property) | |
- id: icestudio_json | |
run: | | |
version=$(jq -r '.version' package.json) | |
echo "icestudio_version=${version}" >> $GITHUB_OUTPUT | |
# -- Debug: Print the icestudio version | |
# -- It is read from the package.json | |
- name: Get the Icestudio version | |
env: | |
VERSION: "${{steps.icestudio_json.outputs.icestudio_version}}" | |
run: | | |
echo "VERSION: ${{ env.VERSION }}" | |
# --------------------------------------- | |
# -- Upload the binaries to the release | |
# --------------------------------------- | |
- name: 'Upload ZIP/Aarch64' | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
VERSION: "${{steps.icestudio_json.outputs.icestudio_version}}" | |
with: | |
upload_url: ${{ needs.build-LinWin.outputs.upload_url }} | |
asset_path: "dist/icestudio-${{env.VERSION}}-aarch64.zip" | |
asset_name: "icestudio-${{env.VERSION}}-aarch64.zip" | |
asset_content_type: application/tar+gzip | |