Skip to content

Commit

Permalink
Add publish to the main workflow. (GitHub #121)
Browse files Browse the repository at this point in the history
  • Loading branch information
tardis4500 committed Dec 31, 2024
1 parent ab44236 commit ec97a1f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 50 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ on:
branches:
- main
- release/*
- feature/*
pull_request:
branches:
- main
- release/*
- feature/*
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand Down Expand Up @@ -76,3 +78,20 @@ jobs:
python-version:
- "3.12"
- "3.13"

pre_release:
if: (github.event_name != 'pull_request') && ((github.ref_name == 'main') || startsWith(github.ref_name, 'release/'))
uses: ./.github/workflows/pypi-publish.yml
# uses: tardis4500/shared-actions/.github/workflows/pypi-publish.yml@main
secrets: inherit
with:
environment: pre_release

release:
if: (github.event_name != 'pull_request') && ((github.ref_name == 'main') || startsWith(github.ref_name, 'release/'))
needs: pre_release
uses: ./.github/workflows/pypi-publish.yml
# uses: tardis4500/shared-actions/.github/workflows/pypi-publish.yml@main
secrets: inherit
with:
environment: release
37 changes: 0 additions & 37 deletions .github/workflows/publish.yml

This file was deleted.

17 changes: 4 additions & 13 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ on:
environment:
required: true
type: string
publish-mode:
required: true
type: string
run-id:
required: true
type: string
python-version:
required: false
type: string
Expand Down Expand Up @@ -40,9 +34,6 @@ jobs:
cache: "pip"
- name: Download artifacts
uses: actions/download-artifact@v4
with:
run-id: ${{ inputs.run-id }}
github-token: ${{ secrets.ARTIFACT_TOKEN }}
- name: Install local vjer
run: pip install $ARTIFACTS_DIR/*.whl
if: inputs.use-local-vjer
Expand All @@ -59,19 +50,19 @@ jobs:
with:
repository-url: https://test.pypi.org/legacy/
packages-dir: ${{ env.ARTIFACTS_DIR }}
if: inputs.publish-mode == 'pre_release'
if: inputs.environment == 'pre_release'
- name: Run post-publish steps
run: vjer ${{ inputs.publish-mode }}
run: vjer ${{ inputs.environment }}
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ${{ env.ARTIFACTS_DIR }}
if: inputs.publish-mode == 'release'
if: inputs.environment == 'release'
- name: Upload released artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACTS_DIR }}
path: ${{ env.ARTIFACTS_DIR }}
if: inputs.publish-mode == 'release'
if: inputs.environment == 'release'

# cSpell:ignore pypa noreply
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Use new override decorator.
- Use pathlib.Path.walk in place of os.walk
- Update rmtree deprecated argument.
- Add publish to the main workflow. (GitHub #121)
- Updated dependencies.

## Release History
Expand Down

0 comments on commit ec97a1f

Please sign in to comment.