dockge-cli/.forgejo/workflows/build-release.yaml
Firq 09da354b0e
All checks were successful
/ pylint (push) Successful in 12s
/ mypy (push) Successful in 14s
/ lint-and-typing (push) Successful in 17s
/ build-artifacts (push) Successful in 8s
/ publish-artifacts (push) Successful in 9s
/ build-and-push-container (push) Successful in 1m15s
/ release (push) Successful in 40s
Fixed workflow 2
2024-07-22 17:47:06 +02:00

92 lines
2.9 KiB
YAML

on:
push:
tags:
- '[0-9]+\.[0-9]+\.[0-9]+-c\.[0-9]+'
- '[0-9]+\.[0-9]+\.[0-9]+-a\.[0-9]+'
- '[0-9]+\.[0-9]+\.[0-9]'
jobs:
lint-and-typing:
runs-on: docker
container: nikolaik/python-nodejs:python3.11-nodejs21
steps:
- name: Checkout source code
uses: https://code.forgejo.org/actions/checkout@v3
- name: Install packages
run: |
pip install -e .[lint,typing] -q --disable-pip-version-check -q
python -m pip list --format=columns --disable-pip-version-check
- name: Run pylint
run: |
pylint --version
pylint **/*.py --exit-zero --rc-file pyproject.toml
- name: Run mypy
run: |
mypy --version
mypy .
build-artifacts:
needs: ["lint-and-typing"]
runs-on: docker
container: nikolaik/python-nodejs:python3.11-nodejs21
steps:
- name: Checkout source code
uses: https://code.forgejo.org/actions/checkout@v3
- name: Install packages
run: pip install build
- name: Build package
run: python -m build
- name: Save build artifacts
uses: https://code.forgejo.org/actions/upload-artifact@v3
with:
name: packages
path: dist/*
publish-artifacts:
needs: ["build-artifacts"]
runs-on: docker
container: nikolaik/python-nodejs:python3.11-nodejs21
steps:
- name: Downloading static site artifacts
uses: actions/download-artifact@v3
with:
name: packages
path: dist
- name: Install Dependencies
run: pip install twine
- name: Upload package to registry
run: python -m twine upload --repository-url ${{ secrets.REPOSITORY_URL }} -u ${{ secrets.TWINE_DEPLOY_USER }} -p ${{ secrets.TWINE_DEPLOY_PASSWORD }} dist/*
build-and-push-container:
needs: [ "publish-artifacts" ]
runs-on: dind
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into Docker Package Registry
uses: docker/login-action@v3
with:
registry: forgejo.neshweb.net
username: ${{ secrets.FORGEJO_USERNAME }}
password: ${{ secrets.FORGEJO_TOKEN }}
- name: Build and push to Docker Package Registry
uses: docker/build-push-action@v5
with:
build-args: |
PACKAGE_VERSION=${{ github.ref_name }}
push: true
tags: forgejo.neshweb.net/firq/dockge-cli:${{ github.ref_name }}
release:
needs: [ build-and-push-container, publish-artifacts ]
if: success()
runs-on: docker
steps:
- name: Release New Version
uses: actions/forgejo-release@v1
with:
direction: upload
url: https://forgejo.neshweb.net
release-dir: release
token: ${{ secrets.FORGEJO_TOKEN }}
tag: ${{ github.ref_name }}