Skip to content

Commit

Permalink
Need to put publish all in primary workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
tardis4500 committed Jan 1, 2025
1 parent 029c9f5 commit 5332eee
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 79 deletions.
70 changes: 60 additions & 10 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ concurrency:

env:
UNIT_TEST_DIR: test_results
ARTIFACTS_DIR: artifacts
GH_TOKEN: ${{ github.token }}
VJER_ENV: development

jobs:
test:
Expand Down Expand Up @@ -83,22 +86,69 @@ jobs:

pre_release:
needs: install-test
uses: ./.github/workflows/pypi-publish.yml
# uses: tardis4500/shared-actions/.github/workflows/pypi-publish.yml@main
with:
environment: pre_release
if: (github.event_name != 'pull_request') && ((github.ref_name == 'main') || startsWith(github.ref_name, 'release/'))
secrets: inherit
permissions:
id-token: write
runs-on: ubuntu-latest
environment: pre_release
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Install vjer
run: pip install vjer
- name: Prepare Git
run: |
git config user.name "${{ github.triggering_actor }}"
git config user.email "${{ github.triggering_actor }}@users.noreply.github.com"
git pull
- name: Publish to Test PyPi
uses: pypa/[email protected]
with:
repository-url: https://test.pypi.org/legacy/
packages-dir: ${{ env.ARTIFACTS_DIR }}
verbose: true
- name: Run post-publish steps
run: vjer pre_release

release:
needs: pre_release
uses: ./.github/workflows/pypi-publish.yml
# uses: tardis4500/shared-actions/.github/workflows/pypi-publish.yml@main
with:
environment: release
if: (github.event_name != 'pull_request') && ((github.ref_name == 'main') || startsWith(github.ref_name, 'release/'))
secrets: inherit
permissions:
id-token: write
runs-on: ubuntu-latest
environment: release
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Install vjer
run: pip install vjer
- name: Prepare Git
run: |
git config user.name "${{ github.triggering_actor }}"
git config user.email "${{ github.triggering_actor }}@users.noreply.github.com"
git pull
- name: Run post-publish steps
run: vjer release
- name: Publish to PyPi
uses: pypa/[email protected]
with:
packages-dir: ${{ env.ARTIFACTS_DIR }}
- name: Upload released artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACTS_DIR }}
path: ${{ env.ARTIFACTS_DIR }}
69 changes: 0 additions & 69 deletions .github/workflows/pypi-publish.yml

This file was deleted.

0 comments on commit 5332eee

Please sign in to comment.