Skip to content

Stable Release

Stable Release #79

# 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) and Upload Window binaries
- name: Create the Stable Release
id: create_release
uses: softprops/action-gh-release@v1
env:
VERSION: "${{steps.icestudio_json.outputs.icestudio_version}}"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
prerelease: false
tag_name: v${{ env.VERSION }}
files: |
dist/icestudio-${{env.VERSION}}-win64.exe
dist/icestudio-${{env.VERSION}}-win64.zip
body: A new release (Draft)
#-- 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 Linux64 binaries
uses: softprops/action-gh-release@v1
env:
VERSION: "${{steps.icestudio_json.outputs.icestudio_version}}"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
prerelease: false
tag_name: v${{ env.VERSION }}
files: |
dist/icestudio-${{env.VERSION}}-linux64.AppImage
dist/icestudio-${{env.VERSION}}-linux64.zip
# 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 Mac binaries to the release
# ---------------------------------------
- name: 'Upload DMG/OSX64'
uses: softprops/action-gh-release@v1
env:
VERSION: "${{fromJson(steps.icestudio_json.outputs.packageJson).version}}"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
prerelease: false
tag_name: v${{ env.VERSION }}
files: |
dist/icestudio-${{env.VERSION}}-osx64.dmg
dist/icestudio-${{env.VERSION}}-osx64.zip
# 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 ARM binaries to the release
# ---------------------------------------
- name: 'Upload ZIP/Aarch64'
uses: softprops/action-gh-release@v1
env:
VERSION: "${{steps.icestudio_json.outputs.icestudio_version}}"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
prerelease: false
tag_name: v${{ env.VERSION }}
files: |
dist/icestudio-${{env.VERSION}}-aarch64.zip