Skip to content

Fixed permissions for publishing releases #45

Fixed permissions for publishing releases

Fixed permissions for publishing releases #45

Workflow file for this run

name: Main
on:
release:
types:
- created
push:
pull_request:
permissions:
# releases
contents: write
# ghcr.io
packages: write
jobs:
ruff:
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
python-version: 3.8
- run: pip install -r requirements-dev.txt
- run: ruff --output-format=github .
docker:
runs-on: ubuntu-22.04
needs:
- ruff
steps:
- uses: actions/[email protected]
- uses: docker/[email protected]
- uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: docker/[email protected]
id: meta
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,format=short,prefix=
type=raw,value=latest,enable={{ is_default_branch }}
- uses: docker/[email protected]
if: ${{ format('refs/heads/{0}', github.event.repository.default_branch) == github.ref || startsWith(github.ref, 'refs/tags/') }}
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
run:
runs-on: ubuntu-22.04
needs:
- docker
steps:
- uses: actions/[email protected]
- uses: ./
env:
GITHUB_TOKEN: ${{ github.token }}
wheel:
runs-on: ubuntu-22.04
needs:
- ruff
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
python-version: 3.8
- run: pip install build
- run: python -m build
- uses: actions/[email protected]
with:
name: ${{ github.event.repository.name }}.Wheel
path: dist/*
if-no-files-found: error
windows:
runs-on: windows-2019
needs:
- ruff
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
python-version: 3.8
- run: pip install -r requirements-dev.txt
- run: python -m nuitka --standalone --onefile --output-filename="5desc" --output-dir="build" --assume-yes-for-downloads fivedesc.py
- uses: actions/[email protected]
with:
name: ${{ github.event.repository.name }}.Windows
path: build/5desc.exe
if-no-files-found: error
pacman:
runs-on: ubuntu-22.04
needs:
- ruff
container: archlinux
steps:
- run: pacman -Syu --noconfirm base-devel git python-pip
- uses: actions/[email protected]
- run: git clone https://aur.archlinux.org/python-marko.git marko && cd marko && makepkg -sif --noconfirm && cd ../ && rm -rf marko
env:
EUID: "1"
- run: pip install -r requirements-dev.txt --break-system-packages
- run: makepkg -sf --noconfirm
env:
EUID: "1"
- uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}.Arch
path: "*.tar.*"
if-no-files-found: error
release:
runs-on: ubuntu-22.04
if: ${{ github.event_name == 'release' }}
needs:
- docker
- wheel
- windows
- pacman
steps:
- uses: actions/[email protected]
with:
name: ${{ github.event.repository.name }}.Wheel
path: dist/Python
- uses: actions/[email protected]
with:
name: ${{ github.event.repository.name }}.Windows
path: dist/Windows
- uses: actions/[email protected]
with:
name: ${{ github.event.repository.name }}.Arch
path: dist/Arch Linux
- run: 7z a ${{ github.event.repository.name }}.zip ${{ github.workspace }}/dist/*
- uses: ncipollo/[email protected]
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: ${{ github.event.repository.name }}.zip
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true