Release #24
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: Release | |
on: | |
push: | |
tags: | |
- '*.*.*' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu", "macos"] | |
steps: | |
- name: Checkout GraphML | |
id: checkout_graphml | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.sha }} | |
- name: Get short SHA | |
id: get_short_sha | |
uses: benjlevesque/[email protected] | |
- name: Install Python | |
id: install_python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install Poetry | |
id: install_poetry | |
uses: snok/install-poetry@v1 | |
- name: Install Dependencies | |
id: install_dependencies | |
run: poetry install --with main | |
- name: Build release | |
id: build_release | |
run: poetry build -f wheel | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
- name: Install Poetry | |
run: | | |
curl -fsS https://install.python-poetry.org | python - -y | |
- name: Update PATH | |
run: echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Check distributions | |
run: | | |
ls -la dist | |
- name: Check Version | |
id: check-version | |
run: | | |
[[ "${GITHUB_REF#refs/tags/}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] \ | |
|| echo ::set-output name=prerelease::true | |
- name: Set tag | |
id: set-tag | |
run: | | |
echo ::set-output name=tag::$(ls dist/*.tar.gz | sed -n 's/.*graph_ml-\(.*\).tar.gz/\1/p') | |
- name: Print TAG | |
run: echo "v${{ steps.set-tag.outputs.tag }}" | |
- name: Delete older release assets | |
uses: mknejp/delete-release-assets@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: "v${{ steps.set-tag.outputs.tag }}" | |
fail-if-no-assets: false | |
fail-if-no-release: false | |
assets: | | |
*.tar.gz | |
*.whl | |
*.zip | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "dist/*" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
draft: false | |
tag: "v${{ steps.set-tag.outputs.tag }}" | |
skipIfReleaseExists: false | |
replacesArtifacts: true | |
prerelease: steps.check-version.outputs.prerelease == 'true' | |
makeLatest: true | |
allowUpdates: true |