minor bugs and improving docs (#136) #46
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
on: | |
push: | |
paths-ignore: | |
- "docs/**" | |
- "**.md" | |
- "examples/**" | |
branches: | |
- "main" | |
- "rc" | |
jobs: | |
PRCheck: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- run: | | |
# Download the binary | |
curl -sLO https://github.com/argoproj/argo-workflows/releases/download/v3.5.4/argo-linux-amd64.gz | |
# Unzip | |
gunzip argo-linux-amd64.gz | |
# Make binary executable | |
chmod +x argo-linux-amd64 | |
# Move binary to path | |
mv ./argo-linux-amd64 /usr/local/bin/argo | |
# Test installation | |
argo version | |
- run: python -m pip install poetry | |
- run: | | |
python -m poetry install | |
poetry run tox | |
Release: | |
runs-on: ubuntu-latest | |
needs: PRCheck | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- run: python -m pip install python-semantic-release==8.0.7 | |
- name: Figure version | |
continue-on-error: true | |
id: last_tag | |
run: | | |
CURRENT=$(git tag --sort=-committerdate -l | head -n 1) | |
echo "current: $CURRENT" | |
VERSION=$(semantic-release --noop --strict version --no-push --no-commit --print) | |
echo "New: $VERSION" | |
if [ "$CURRENT" == "$VERSION" ]; then | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
exit 1 | |
fi | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
exit 0 | |
- name: Apply new tag | |
if: steps.last_tag.outcome == 'success' | |
env: | |
VERSION: ${{ steps.last_tag.outputs.version }} | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const {VERSION} = process.env | |
const tag = `refs/tags/${VERSION}` | |
await github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: tag, | |
sha: context.sha | |
}) | |
- name: Publish to PyPI | |
if: steps.last_tag.outcome == 'success' | |
env: | |
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
LAST_TAG: ${{ steps.last_tag.outputs.version }} | |
run: | | |
python -m pip install poetry | |
python scripts/update_version.py $LAST_TAG | |
poetry config pypi-token.pypi $PYPI_TOKEN | |
poetry publish --build | |
- name: "Create release" | |
if: steps.last_tag.outcome == 'success' | |
env: | |
RELEASE_TAG: ${{ steps.last_tag.outputs.version }} | |
uses: "actions/github-script@v6" | |
with: | |
github-token: "${{ secrets.GITHUB_TOKEN }}" | |
script: | | |
try { | |
const response = await github.rest.repos.createRelease({ | |
draft: false, | |
generate_release_notes: true, | |
name: process.env.RELEASE_TAG, | |
owner: context.repo.owner, | |
prerelease: false, | |
repo: context.repo.repo, | |
tag_name: process.env.RELEASE_TAG, | |
}); | |
core.exportVariable('RELEASE_ID', response.data.id); | |
core.exportVariable('RELEASE_UPLOAD_URL', response.data.upload_url); | |
} catch (error) { | |
core.setFailed(error.message); | |
} |