Skip to content

Commit

Permalink
Update python-package.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
JoKra1 authored Nov 27, 2023
1 parent 6c4cda7 commit e123c6c
Showing 1 changed file with 37 additions and 24 deletions.
61 changes: 37 additions & 24 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@

name: Python package

on: workflow_dispatch
on:
push:
branches:
-stable
workflow_dispatch:

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]
os: [macos-latest,ubuntu-latest,windows-latest]

permissions:
contents: write # Necessary for creating releases apparently.

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -48,23 +48,36 @@ jobs:
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

release:
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
needs:
- build
runs-on: ubuntu-latest

# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' ./wheelhouse/*.whl
--repo '${{ github.repository }}'
permissions:
contents: write # Necessary for creating releases apparently.

steps:

- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: ./wheelhouse/*.whl

- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
- name: Connect Artifacts to release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release upload
'${{ github.ref_name }}' ./wheelhouse/*.whl
--repo '${{ github.repository }}'

0 comments on commit e123c6c

Please sign in to comment.