Migrated to DGL’s GitHub repos #2
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
# vim: set tabstop=2 softtabstop=2 shiftwidth=2 expandtab: | |
name: Create a release and deploy to PyPi whenever a protected tag (v0.0.0) is created | |
on: | |
push: | |
tags: | |
- v*.*.* | |
jobs: | |
build: | |
name: Build package | |
uses: ./.github/workflows/build.yml | |
secrets: inherit | |
merge-into-stable: | |
name: Update stable branch to point to this release | |
runs-on: ubuntu-latest | |
needs: [build] | |
if: "!contains(github.ref, 'dev')" | |
permissions: write-all | |
steps: | |
- name: Clone repository, check-out stable | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ref: stable | |
- name: Merge tag into stable | |
run: | | |
TAG="${{github.ref}}" # /ref/tags/v0.0.0 | |
git merge "${TAG:10}" | |
git push | |
deploy: | |
name: Upload built package to PyPi | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- name: Download built artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: package | |
path: dist/ | |
- name: Upload package to PyPi | |
uses: pypa/gh-action-pypi-publish@release/v1.5 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
skip_existing: true | |
release: | |
name: Create a new release | |
runs-on: ubuntu-latest | |
needs: [deploy] | |
if: "!contains(github.ref, 'dev')" | |
permissions: | |
contents: write | |
steps: | |
- name: Download built artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: package | |
path: dist/ | |
- name: Create release and upload package | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: dist/* | |
prerelease: | |
name: Create a new pre-release | |
runs-on: ubuntu-latest | |
needs: [deploy] | |
if: contains(github.ref, 'dev') | |
permissions: | |
contents: write | |
steps: | |
- name: Download built artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: package | |
path: dist/ | |
- name: Create release and upload package | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: dist/* | |
prerelease: true |