Skip to content

Merge pull request #865 from jupyterlab/release-v4.2.5-1 #1217

Merge pull request #865 from jupyterlab/release-v4.2.5-1

Merge pull request #865 from jupyterlab/release-v4.2.5-1 #1217

Workflow file for this run

name: Publish
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
publish:
strategy:
matrix:
cfg:
- { platform: linux-64, platform_name: Linux x64, os: ubuntu-latest, build_platform: linux-64, conda_platform: linux-64 }
- { platform: osx-64, platform_name: macOS x64, os: macos-latest, build_platform: osx-64, conda_platform: osx-64 }
- { platform: osx-arm64, platform_name: macOS arm64, os: macos-latest, build_platform: osx-64, conda_platform: osx-arm64 }
- { platform: win-64, platform_name: Windows x64, os: windows-latest, build_platform: win-64, conda_platform: win-64 }
name: '${{ matrix.cfg.platform_name }} installer'
runs-on: ${{ matrix.cfg.os }}
defaults:
run:
# needed for conda to work
shell: bash -el {0}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
auto-activate-base: true
activate-environment: ""
channels: conda-forge
- run: conda install --file ./workflow_env/conda-${{ matrix.cfg.build_platform }}.lock -y
- name: Install node
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'yarn'
- name: Install dependencies
run: |
npm install --global yarn --prefer-offline
yarn install
- name: Check JupyterLab version match
run: |
yarn check_version_match
- name: Check Lint & Prettier
run: |
yarn lint:check
- name: Get package info
shell: bash
id: package-info
run: echo "version=$(python scripts/get_package_version.py)" >> $GITHUB_OUTPUT
- name: 'Find Release with tag v${{ steps.package-info.outputs.version}}'
uses: actions/github-script@v7
id: release-exists
env:
APP_VERSION: ${{ steps.package-info.outputs.version}}
with:
script: |
const releases = await github.rest.repos.listReleases({
owner: context.repo.owner,
repo: context.repo.repo
})
const tagName = `v${process.env.APP_VERSION}`
const releaseWithTag = releases.data.find(release => release.tag_name === tagName && (release.draft || release.prerelease))
return releaseWithTag ? 'true' : 'false'
result-encoding: string
- name: Create Application Server Installer
run: |
yarn create_env_installer:${{ matrix.cfg.platform }}
# contents of tarball needs to be signed for notarization
- name: Codesign Application Server
if: (matrix.cfg.platform == 'osx-64' || matrix.cfg.platform == 'osx-arm64') && steps.release-exists.outputs.result == 'true'
env:
CSC_IDENTITY_AUTO_DISCOVERY: true
CSC_FOR_PULL_REQUEST: true
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
APPLEID: ${{ secrets.APPLEID }}
APPLEIDPASS: ${{ secrets.APPLEIDPASS }}
ENV_INSTALLER_KEYCHAIN_PASS: ${{ secrets.ENV_INSTALLER_KEYCHAIN_PASS }}
run: |
echo "Extracting env installer"
yarn extract_env_installer:${{ matrix.cfg.platform }}
echo $CSC_LINK | base64 -d -o certificate.p12
security create-keychain -p $ENV_INSTALLER_KEYCHAIN_PASS build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p $ENV_INSTALLER_KEYCHAIN_PASS build.keychain
security import certificate.p12 -k build.keychain -P $CSC_KEY_PASSWORD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $ENV_INSTALLER_KEYCHAIN_PASS build.keychain
echo "Signing env binaries"
while read line; do /usr/bin/codesign --force --options=runtime --deep -s "Developer ID Application" ./env_installer/jlab_server_extracted/"$line" -v; done < ./env_installer/sign-${{ matrix.cfg.platform }}.txt
rm certificate.p12
security delete-keychain build.keychain
# recreate tarball after signing contents
- name: Re-archive Application Server Installer
if: (matrix.cfg.platform == 'osx-64' || matrix.cfg.platform == 'osx-arm64') && steps.release-exists.outputs.result == 'true'
run: |
yarn compress_env_installer:${{ matrix.cfg.platform }}
rm -rf ./env_installer/jlab_server_extracted
- name: Create Application Installer for Test
env:
CSC_IDENTITY_AUTO_DISCOVERY: false # disable code signing if not release asset
run: |
yarn dist:${{ matrix.cfg.platform }}
if: steps.release-exists.outputs.result == 'false'
- name: Create Application Installer for Release
env:
CSC_IDENTITY_AUTO_DISCOVERY: true
CSC_FOR_PULL_REQUEST: true
APPLEID: ${{ secrets.APPLEID }}
APPLEIDPASS: ${{ secrets.APPLEIDPASS }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
CSC_LINK: ${{ secrets.CSC_LINK }}
run: |
yarn dist:${{ matrix.cfg.platform }}
if: steps.release-exists.outputs.result == 'true'
- name: Upload Debian x64 Installer
if: matrix.cfg.platform == 'linux-64'
uses: actions/upload-artifact@v4
with:
name: debian-installer-x64
path: |
dist/JupyterLab.deb
- name: Upload Fedora x64 Installer
if: matrix.cfg.platform == 'linux-64'
uses: actions/upload-artifact@v4
with:
name: fedora-installer-x64
path: |
dist/JupyterLab.rpm
- name: Upload Snap Installer
if: matrix.cfg.platform == 'linux-64'
uses: actions/upload-artifact@v4
id: snap-artifact
with:
name: snap-installer
path: |
dist/JupyterLab.snap
- name: Upload macOS x64 Installer
if: matrix.cfg.platform == 'osx-64'
uses: actions/upload-artifact@v4
with:
name: mac-installer-x64
path: |
dist/JupyterLab-x64.dmg
- name: Upload macOS arm64 Installer
if: matrix.cfg.platform == 'osx-arm64'
uses: actions/upload-artifact@v4
with:
name: mac-installer-arm64
path: |
dist/JupyterLab-arm64.dmg
- name: Upload Windows x64 Installer
if: matrix.cfg.platform == 'win-64'
uses: actions/upload-artifact@v4
with:
name: windows-installer-x64
path: |
dist/JupyterLab-Setup.exe
- name: Upload Debian x64 Installer as Release asset
if: matrix.cfg.platform == 'linux-64' && steps.release-exists.outputs.result == 'true'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.JLAB_APP_TOKEN }}
file: dist/JupyterLab.deb
asset_name: JupyterLab-Setup-Debian-x64.deb
tag: v${{ steps.package-info.outputs.version}}
overwrite: true
- name: Upload Fedora x64 Installer as Release asset
if: matrix.cfg.platform == 'linux-64' && steps.release-exists.outputs.result == 'true'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.JLAB_APP_TOKEN }}
file: dist/JupyterLab.rpm
asset_name: JupyterLab-Setup-Fedora-x64.rpm
tag: v${{ steps.package-info.outputs.version}}
overwrite: true
- name: Upload macOS x64 Installer as Release asset
if: matrix.cfg.platform == 'osx-64' && steps.release-exists.outputs.result == 'true'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.JLAB_APP_TOKEN }}
file: dist/JupyterLab-x64.dmg
asset_name: JupyterLab-Setup-macOS-x64.dmg
tag: v${{ steps.package-info.outputs.version}}
overwrite: true
- name: Upload macOS arm64 Installer as Release asset
if: matrix.cfg.platform == 'osx-arm64' && steps.release-exists.outputs.result == 'true'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.JLAB_APP_TOKEN }}
file: dist/JupyterLab-arm64.dmg
asset_name: JupyterLab-Setup-macOS-arm64.dmg
tag: v${{ steps.package-info.outputs.version}}
overwrite: true
- name: Upload macOS x64 App as Release asset
if: matrix.cfg.platform == 'osx-64' && steps.release-exists.outputs.result == 'true'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.JLAB_APP_TOKEN }}
file: dist/JupyterLab-x64.zip
asset_name: JupyterLab-macOS-x64.zip
tag: v${{ steps.package-info.outputs.version}}
overwrite: true
- name: Upload macOS arm64 App as Release asset
if: matrix.cfg.platform == 'osx-arm64' && steps.release-exists.outputs.result == 'true'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.JLAB_APP_TOKEN }}
file: dist/JupyterLab-arm64.zip
asset_name: JupyterLab-macOS-arm64.zip
tag: v${{ steps.package-info.outputs.version}}
overwrite: true
- name: Upload Windows x64 Installer as Release asset
if: matrix.cfg.platform == 'win-64' && steps.release-exists.outputs.result == 'true'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.JLAB_APP_TOKEN }}
file: dist/JupyterLab-Setup.exe
asset_name: JupyterLab-Setup-Windows-x64.exe
tag: v${{ steps.package-info.outputs.version}}
overwrite: true
- name: Upload latest.yml Release asset
if: matrix.cfg.platform == 'win-64' && steps.release-exists.outputs.result == 'true'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.JLAB_APP_TOKEN }}
file: dist/latest.yml
asset_name: latest.yml
tag: v${{ steps.package-info.outputs.version}}
overwrite: true
- name: Upload snap installer as Release asset
if: matrix.cfg.platform == 'linux-64' && steps.release-exists.outputs.result == 'true'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.JLAB_APP_TOKEN }}
file: dist/JupyterLab.snap
asset_name: JupyterLab-Setup.snap
tag: v${{ steps.package-info.outputs.version}}
overwrite: true
- name: Publish snap to the latest/candidate channel in Snap Store
if: matrix.cfg.platform == 'linux-64' && steps.release-exists.outputs.result == 'true'
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
with:
snap: dist/JupyterLab.snap
release: candidate