Skip to content

chore(release): prepare for v3.0.3-rc.4 #423

chore(release): prepare for v3.0.3-rc.4

chore(release): prepare for v3.0.3-rc.4 #423

Workflow file for this run

name: Main
on:
push:
branches: [main]
tags:
- "v*"
pull_request:
branches: [main]
permissions:
contents: read
jobs:
lint:
name: Lint code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
cache: poetry
- name: Install deps
run: poetry install
- name: Lint code
run: poetry run poe lint
tests:
name: Tests
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- name: Install deps
run: poetry install
- name: Run tests
run: poetry run poe test
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
uses: codecov/codecov-action@4fe8c5f003fae66aa5ebb77cfd3e7bfbbda0b6b0 # v3.1.5
pypi-deploy:
name: Release to PyPI
if: github.ref_type == 'tag'
needs: [lint, tests]
permissions:
id-token: write
environment: pypi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: |
pipx install poetry
pipx inject poetry poetry-dynamic-versioning[plugin]
- uses: actions/setup-python@v5
- name: Build package
run: poetry build
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 # v1.8.14
aur-deploy:
name: Release to AUR
if: true && !contains(github.ref, 'alpha') && !contains(github.ref, 'beta')
needs: [pypi-deploy]
environment:
name: aur
url: https://aur.archlinux.org/packages/python-images-upload-cli
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update version in PKGBUILD
run: |
sed "s|^pkgver=.*$|pkgver=\"3.0.2\"|" -i PKGBUILD
echo ${GITHUB_REF_NAME#v}
# sed "s|^pkgver=.*$|pkgver=\"${{ github.ref_name#v }}\"|" -i PKGBUILD
- name: Deploy PKGBUILD to the Arch User Repository
uses: ksxgithub/github-actions-deploy-aur@063daf78a56662642bb00049ce78425ff6d0fad7 # v2.7.0
with:
pkgname: python-images-upload-cli
pkgbuild: ./PKGBUILD
commit_username: DeadNews
commit_email: deadnewsgit@gmail.com
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: Upstream release ${{ github.ref_name }}
updpkgsums: true
github-deploy:
name: Release to GitHub
if: github.ref_type == 'tag'
needs: [lint, tests]
environment: github-releases
permissions:
contents: write
env:
CHANGELOG: https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md
PRERELEASE: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create GitHub Release
run: |
gh release create ${{ github.ref_name }} \
--title ${{ github.ref_name }} \
--notes="See [the CHANGELOG](${{ env.CHANGELOG }}) for more details." \
--draft=${{ env.PRERELEASE }} \
--prerelease=${{ env.PRERELEASE }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-win:
name: Windows Build
if: github.ref_type == 'tag'
needs: [github-deploy]
environment: github-releases
permissions:
contents: write
env:
BINARY: images-upload-cli.exe
ASSET: images-upload-cli_${{ github.ref_name }}_windows_amd64.zip
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: poetry
- name: Install deps
run: poetry install
- name: Build binaries
uses: nuitka/nuitka-action@12e193a947ea7cb9c807a4e4161092f2c16ac501 # v1.1
with:
nuitka-version: main
script-name: src/images_upload_cli/__main__.py
output-dir: dist
output-file: ${{ env.BINARY }}
onefile: true
- name: Archive binaries
run: poetry run python -m zipfile --create ${{ env.ASSET }} dist/${{ env.BINARY }}
- name: Upload binaries to Release
run: gh release upload ${{ github.ref_name }} ${{ env.ASSET }}
env:
GITHUB_TOKEN: ${{ github.token }}
docs-build:
name: Build docs
if: github.ref_type == 'tag'
needs: [lint, tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
cache: poetry
- name: Install deps
run: poetry install
- name: Build docs
run: poetry run mkdocs build
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: site
docs-deploy:
name: Deploy docs
if: true && !contains(github.ref, 'alpha') && !contains(github.ref, 'rc')
needs: [docs-build]
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
id-token: write
pages: write
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4