Skip to content

Commit

Permalink
Fix workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
  • Loading branch information
thombashi committed Apr 30, 2024
1 parent 5336897 commit 0d078b7
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 29 deletions.
33 changes: 23 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,39 @@ jobs:
concurrency:
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref_name }}-build-pkg
cancel-in-progress: true
container:
image: ghcr.io/thombashi/python-ci:3.11
timeout-minutes: 20

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
cache-dependency-path: |
setup.py
**/*requirements.txt
tox.ini
- run: make build
- run: make setup-ci

- uses: actions/upload-artifact@v4
with:
name: dist
path: ./dist/*
- run: make build

- uses: actions/upload-artifact@v4
with:
name: dist
path: ./dist/*

publish-package:
needs: build-package
runs-on: ubuntu-latest
concurrency:
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref_name }}-publish-pkg
cancel-in-progress: true
timeout-minutes: 20
timeout-minutes: 10
environment:
name: testpypi
url: https://pypi.org/p/DateTimeRange
Expand All @@ -62,7 +75,7 @@ jobs:
concurrency:
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref_name }}-sign-pkg
cancel-in-progress: true
timeout-minutes: 20
timeout-minutes: 10
permissions:
id-token: write

Expand Down
66 changes: 47 additions & 19 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,36 @@ on:
jobs:
build-package:
runs-on: ubuntu-latest
container:
image: ghcr.io/thombashi/python-ci:3.11
timeout-minutes: 20

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- run: make build
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: |
setup.py
**/*requirements.txt
tox.ini
- uses: actions/upload-artifact@v4
with:
name: dist
path: ./dist/*
- run: make setup-ci

- run: make build

- uses: actions/upload-artifact@v4
with:
name: dist
path: ./dist/*

publish-package:
needs: build-package
runs-on: ubuntu-latest
timeout-minutes: 10
environment:
name: pypi
url: https://pypi.org/p/DateTimeRange
Expand All @@ -40,15 +54,29 @@ jobs:
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

- name: Sign the dists with Sigstore
uses: sigstore/gh-action-sigstore-python@v2.1.1
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
generate-relese:
needs: publish-package
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
id-token: write
contents: write

- name: Generate a GitHub release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: dist/*
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: ./dist

- name: Sign the dists with Sigstore
uses: sigstore/gh-action-sigstore-python@v2.1.1
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Generate a GitHub release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: dist/*

0 comments on commit 0d078b7

Please sign in to comment.