Skip to content

Commit

Permalink
Merge pull request #122 from tardis4500/feature/better-publish
Browse files Browse the repository at this point in the history
Feature/better publish
  • Loading branch information
tardis4500 authored Dec 31, 2024
2 parents ab44236 + aef81a2 commit 91a6cfa
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 52 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: BatCave Build
run-name: BatCave Build - ${{ github.run_id }}
name: BatCave Build and Release
run-name: BatCave Build and Release - ${{ github.run_id }}
on:
workflow_dispatch:
push:
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,21 @@ jobs:
python-version:
- "3.12"
- "3.13"

pre_release:
needs: install-test
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:
needs: 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: 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 91a6cfa

Please sign in to comment.