Skip to content

Commit

Permalink
Testing nightly workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
olivier-roussel committed Jan 14, 2025
1 parent 3f42385 commit 0b0a8f7
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 15 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/build_publish_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ on:
python:
required: false
type: string
build-type:
is-nightly:
required: false
type: boolean
version:
required: false
type: string
git-ref:
required: false
type: string
anaconda-channel:
Expand Down Expand Up @@ -67,6 +73,20 @@ jobs:
conda config --show
printenv | sort
- name: Configuring recipe for build type
shell: bash -l {0}
run: |
export SOFA_PACKAGE_VERSION="${{ inputs.version }}"
export SOFA_PACKAGE_GIT_REF="${{ inputs.git-ref }}"
if [ ${{ inputs.is-nightly }} = "true" ]; then
export SOFA_PACKAGE_BUILD_STRING="string: nightly_\$\{\{ env.get(\"GIT_BUILD_STRING\") \}\}"
echo $SOFA_PACKAGE_BUILD_STRING
fi
cd conda/recipes
envsubst < ${{ inputs.package-name }}/recipe.yaml.in > ${{ inputs.package-name }}/recipe.yaml
echo "Configured recipe.yaml:"
cat ${{ inputs.package-name }}/recipe.yaml
# Same remark here about too long filename bug on windows, we have to force the output directory accordingly on windows
- name: Build & publish sofa conda package
shell: bash -l {0}
Expand All @@ -79,8 +99,8 @@ jobs:
PKG_DIR=../../../rattler-bld
fi
if [ ! -z "${{ inputs.python }}" ]; then
rattler-build build --recipe ${{ inputs.package-name }}/recipe.yaml --variant-config ../configs/${{ inputs.platform }}.yaml --variant-config ../configs/${{ inputs.build-type }}.yaml ../configs/python-${{ inputs.python }}.yaml --output-dir $PKG_DIR --experimental -c conda-forge -c ${{ inputs.anaconda-channel }}
rattler-build build --recipe ${{ inputs.package-name }}/recipe.yaml --variant-config ../configs/${{ inputs.platform }}.yaml ../configs/python-${{ inputs.python }}.yaml --output-dir $PKG_DIR --experimental -c conda-forge -c ${{ inputs.anaconda-channel }}
else
rattler-build build --recipe ${{ inputs.package-name }}/recipe.yaml --variant-config ../configs/${{ inputs.platform }}.yaml --variant-config ../configs/${{ inputs.build-type }}.yaml --output-dir $PKG_DIR --experimental -c conda-forge -c ${{ inputs.anaconda-channel }}
rattler-build build --recipe ${{ inputs.package-name }}/recipe.yaml --variant-config ../configs/${{ inputs.platform }}.yaml --output-dir $PKG_DIR --experimental -c conda-forge -c ${{ inputs.anaconda-channel }}
fi
anaconda -t ${{ secrets.anaconda-token }} upload -u ${{ inputs.anaconda-channel }} -l main $PKG_DIR/**/*${{ inputs.package-name }}*.conda --force
26 changes: 26 additions & 0 deletions .github/workflows/sofa-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: nightly-sofa
on:
- workflow_call
- workflow_dispatch

jobs:
build-publish-sofa:
strategy:
fail-fast: false
matrix:
target: [{platform: "linux-64", runner: "ubuntu-latest"},
{platform: "osx-64", runner: "macos-13"},
{platform: "osx-arm64", runner: "macos-14"},
{platform: "win-64", runner: "windows-latest"}]

uses: ./.github/workflows/build_publish_package.yml
with:
package-name: sofa
runner: ${{ matrix.target.runner }}
platform: ${{ matrix.target.platform }}
anaconda-channel: sofa-framework-nightly
is-nightly: true
version: "24.12.99"
git-ref: "branch: master"
secrets:
anaconda-token: ${{ secrets.ANACONDA_NIGHTLY_TOKEN }}
4 changes: 3 additions & 1 deletion .github/workflows/sofa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
runner: ${{ matrix.target.runner }}
platform: ${{ matrix.target.platform }}
anaconda-channel: sofa-framework
build-type: sofa-release-v24.12
is-nightly: false
version: "24.12.00"
git-ref: "tag: v24.12.00"
secrets:
anaconda-token: ${{ secrets.ANACONDA_TOKEN }}
4 changes: 0 additions & 4 deletions conda/configs/sofa-nightly-v24.12.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions conda/configs/sofa-release-v24.12.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
context:
name: sofa
version: ${{ sofa_version }}
build_num: 0
version: $SOFA_PACKAGE_VERSION
build_num: $SOFA_PACKAGE_BUILD_NUMBER

recipe:
name: ${{ name }}
version: ${{ version }}

build:
number: ${{ build_num }}
$SOFA_PACKAGE_BUILD_STRING

source:
# url: https://github.com/sofa-framework/sofa/archive/refs/tags/v${{ version }}.tar.gz
# sha256: ee208e6e2ac4af6930626ae42e70993b2d5944ed879929a0e6abc29ad742e58a
git: https://github.com/sofa-framework/sofa.git
branch: ${{ git_branch }}
$SOFA_PACKAGE_GIT_REF

patches:
# Some components that are part of the main SOFA code tree have to be compiled separately
Expand Down

0 comments on commit 0b0a8f7

Please sign in to comment.