Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build PyPI package and Binder image | |
on: | |
workflow_dispatch: | |
workflow_call: | |
release: | |
types: [ published ] | |
jobs: | |
move-tag: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Move tag | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
try { | |
await github.rest.git.deleteRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: "tags/latest-release", | |
}) | |
} catch (e) { | |
console.log("Tag does not exist." + e) | |
} | |
await github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: "refs/tags/latest-release", | |
sha: context.sha | |
}) | |
build-binder-image: | |
needs: move-tag | |
uses: ./.github/workflows/build_for_Binder.yml | |
build-publish-package: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python-version: [ "3.10" ] | |
os: [ ubuntu-latest ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
run: | | |
pipx install poetry==${{ vars.POETRY_VERSION }} | |
pipx inject poetry poetry-dynamic-versioning[plugin] | |
shell: bash | |
- name: Poetry path | |
run: echo "$HOME/.poetry/bin" >> $GITHUB_PATH | |
shell: bash | |
- name: Build FAST-OAD-core | |
run: poetry build | |
shell: bash | |
- name: publish FAST-OAD-core to PyPI | |
env: | |
TOKEN: ${{ secrets.PyPI }} # do not use the secret directly in run command, it would write it plainly in the log | |
run: | | |
poetry config pypi-token.pypi "$TOKEN" | |
poetry publish | |
- name: build and publish FAST-OAD | |
env: | |
TOKEN: ${{ secrets.PyPI }} # do not use the secret directly in run command, it would write it plainly in the log | |
run: | | |
cd release | |
cp ../README.md . | |
sed -i "s/0.0.0.0.0/$( poetry version -s )/" pyproject.toml && poetry build | |
poetry config pypi-token.pypi "$TOKEN" | |
poetry publish | |
shell: bash |