Skip to content

Stable Release

Stable Release #84

# 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@v4
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@v4
with:
node-version: '21.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@v2
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: |
sudo apt install -y libfuse2
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@v2
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@v4
with:
ref: master
- name: Setup Nodejs version
uses: actions/setup-node@v4
with:
node-version: '21.1.0'
- name: Install npm dependencies
run: |
sed -i '' 's/darwinDependencies/dependencies/g' package.json
npm install --legacy-peer-deps
- name: Build OSX ARM64 packages
env:
MACOS_CERTIFICATE: ${{ secrets.APPLE_CERT_DATA }}
MACOS_CERTIFICATE_PWD: ${{ secrets.APPLE_CERT_PASSWORD }}
CODESIGN_ID: ${{ secrets.APPLE_TEAM_ID }}
MACOS_KEYCHAIN_PASS: ${{ secrets.LOCAL_KEYCHAIN_PASS }}
run: |
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p $MACOS_KEYCHAIN_PASS build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p $MACOS_KEYCHAIN_PASS build.keychain
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $MACOS_KEYCHAIN_PASS build.keychain
npm run buildOSXARM64
ls dist/
# Loading vars from icestudio package.json
- id: icestudio_json
run: |
content=`tr '\n' ' ' < package.json`
echo "packageJson=${content}" >> $GITHUB_OUTPUT
# Read the icestudio version from package.json (version property)
- id: icestudio_version_json
run: |
version=$(jq -r '.version' package.json)
echo "icestudio_version=${version}" >> $GITHUB_OUTPUT
- name: Sign DMG
env:
ICESTUDIO_VERSION: "${{fromJson(steps.icestudio_json.outputs.packageJson).version}}"
MACOS_APPLE_UID: ${{ secrets.APPLE_TEAM_ID }}
run: |
codesign --force --deep --sign ${MACOS_APPLE_UID} dist/icestudio-${ICESTUDIO_VERSION}-osxarm64.dmg -v
# ---------------------------------------
# -- Upload Mac binaries to the release
# ---------------------------------------
- name: 'Upload DMG/OSX64'
uses: softprops/action-gh-release@v2
env:
# VERSION: "${{fromJson(steps.icestudio_json.outputs.packageJson).version}}"
VERSION: "${{steps.icestudio_version_json.outputs.icestudio_version}}"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
prerelease: false
tag_name: v${{ env.VERSION }}
files: |
dist/icestudio-${{env.VERSION}}-osxarm64.dmg
# 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@v4
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@v4
with:
node-version: '19.3.0'
- name: Install npm dependencies
run: npm install --legacy-peer-deps
- name: Build ARM
run: |
sudo apt install -y libfuse2
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@v2
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