Update and rename publish_on_tag.yml to release_on_tag.yml #2
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
--- | ||
# yamllint disable rule:line-length | ||
name: Release on tag | ||
on: # yamllint disable-line rule:truthy | ||
push: | ||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/prod' && "contains(github.event.head_commit.message, '[ci-release]')" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.PUBLISH_ON_TAG_CI_TOKEN }} | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: PyProject and create tag | ||
id: create-tag | ||
env: | ||
VERSION: ${{ (echo $github.event.head_commit.message | cut -d ":" -f2) }} | ||
Check failure on line 25 in .github/workflows/release_on_tag.yml GitHub Actions / Release on tagInvalid workflow file
|
||
run: | | ||
poetry version ${{ env.VERSION }} | ||
git tag -a ${{ env.VERSION }} -m ${{ env.VERSION }} | ||
git push prod | ||
- name: Publish package to PyPI | ||
id: publish-pacakge | ||
run: | | ||
pip install --upgrade pip | ||
pip install poetry | ||
poetry config repositories.gitlab ${{ vars.ESRF_GITLAB_PYPI_URI }} | ||
poetry config http-basic.gitlab gitlab-ci-token ${{ secrets.ESRF_GITLAB_PYPI_TOKEN }} | ||
poetry version ${{ github.ref_name }} | ||
poetry build | ||
poetry publish --repository gitlab |