Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions .github/workflows/build-updater.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Updater Release

on:
push:
branches:
- main
pull_request:
branches:
- main

release:
types:
- created

workflow_dispatch:
inputs:
pre:
description: 'Build as release candidate'
required: false
default: true
type: boolean
ssh:
# github_cli: gh workflow run updater-release.yml --repo spyder-ide/spyder-updater --ref <branch> -f ssh=true
description: 'Enable ssh debugging'
required: false
default: false
type: boolean

concurrency:
group: updater-release-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build conda package
runs-on: ubuntu-latest
defaults:
run:
shell: bash -le {0}

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ''

- name: Setup Remote SSH Connection
if: inputs.ssh
uses: mxschmitt/action-tmate@v3
timeout-minutes: 60
with:
detached: true

- name: Setup Build Environment
uses: mamba-org/setup-micromamba@v1
with:
condarc: |
conda_build:
pkg_format: '2'
zstd_compression_level: '19'
channels:
- conda-forge
environment-name: build
create-args: >-
python=3.11
conda-build
conda-lock
cache-downloads: true
cache-environment: true

- name: Environment Variables
run: |
export DISTDIR=${GITHUB_WORKSPACE}/dist
echo "DISTDIR=$DISTDIR" >> $GITHUB_ENV

export CONDA_BLD_PATH=${RUNNER_TEMP}/conda-bld
echo "CONDA_BLD_PATH=$CONDA_BLD_PATH" >> $GITHUB_ENV

env | sort

ls -al

- name: Build spyder-updater Conda Package
run: |
mkdir -p $CONDA_BLD_PATH
conda config --set bld_path $CONDA_BLD_PATH
conda config --set conda_build.root-dir $CONDA_BLD_PATH
conda build --no-anaconda-upload recipe

- name: Create Conda Lock Files
run: |
mkdir -p $DISTDIR
conda-lock lock --kind explicit --file pyproject.toml --filename-template $DISTDIR/conda-{platform}.lock

- name: Create Distribution File
run: |
mv $CONDA_BLD_PATH/noarch/*.conda $DISTDIR
zip -mT spyder-updater $DISTDIR/*.*

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
path: ${{ env.DISTDIR }}/spyder-updater.zip
name: spyder-updater

- name: Get Release
if: github.event == 'release'
uses: bruceadams/get-release@v1.3.2
id: get_release
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Upload Release Asset
if: github.event == 'release'
uses: shogo82148/actions-upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{ env.DISTDIR }}/spyder-updater.zip
Loading