Skip to content

Commit

Permalink
Revert "Remove use of artifacts"
Browse files Browse the repository at this point in the history
This reverts commit 1f8a6fb.
  • Loading branch information
benoit-cty committed Dec 5, 2023
1 parent bf31d9e commit 1acc2e1
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -303,16 +303,36 @@ jobs:
auto-update-conda: true
python-version: "3.9.9"
# Add conda-forge for OpenFisca-Core
channels: openfisca,conda-forge
channels: conda-forge
activate-environment: true
- name: Get source code
uses: actions/checkout@v3
- name: Get version
run: echo "PACKAGE_VERSION=$(python3 ./setup.py --version)" >> $GITHUB_ENV
- name: Build and Upload to Conda
# Get the last commit hash on the PR (-2 : before the merge commit)
- uses: actions/github-script@v6
id: last_pr_commit
with:
script: |
const commits = ${{ toJSON(github.event.commits) }}
return commits.at(-2).id;
result-encoding: string
# Default Download artifact don't see artifact of other workflow
# So we use dawidd6/action-download-artifact@v2 to do it.
- name: Download artifact
id: download-artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow_conclusion: success
commit: ${{steps.last_pr_commit.outputs.result}}
name: conda-build-${{ env.PACKAGE_VERSION }}-${{steps.last_pr_commit.outputs.result}}
path: conda-build-tmp
event: push # To avoid conflict with PR workflow
if_no_artifact_found: fail
- name: Conda upload
# This shell is made necessary by https://github.com/conda-incubator/setup-miniconda/issues/128
shell: bash -l {0}
run: |
conda install -y conda-build anaconda-client
conda config --set anaconda_upload yes
conda build -c conda-forge -c openfisca --token ${{ secrets.ANACONDA_TOKEN }} --user openfisca .conda
conda install anaconda-client
conda info
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload -u openfisca ./conda-build-tmp/noarch/openfisca-france-*-py_0.tar.bz2 --force

0 comments on commit 1acc2e1

Please sign in to comment.