Files
eos/.github/workflows/release.yml
Artur Glavic bada209c1e
Some checks failed
Release / build-ubuntu-latest (push) Failing after 2s
Release / release (push) Has been skipped
minor fix of release workflow and add github release
2024-10-30 14:31:06 +01:00

69 lines
1.8 KiB
YAML

name: Release
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
tags:
- "*"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
build-items:
description: 'Items to be build'
required: true
default: 'all'
type: choice
options:
- all
- windows
- linux
- mac
jobs:
build-ubuntu-latest:
runs-on: ubuntu-latest
if: ${{ (github.event_name != 'workflow_dispatch') || (contains(fromJson('["all", "linux"]'), github.event.inputs.build-items)) }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install -r requirements.txt
- name: Build PyPI package
run: |
python3 -m build
- name: Upload to PyPI
if: github.event_name != 'workflow_dispatch'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
skip-existing: true
- name: Archive distribution
uses: actions/upload-artifact@v4
with:
name: linux-dist
path: |
dist/*.tar.gz
release:
if: github.event_name != 'workflow_dispatch'
runs-on: ubuntu-latest
needs: [build-ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: linux-dist
- uses: ncipollo/release-action@v1
with:
artifacts: "amor*.tar.gz"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true