BatCave Build and Release - 13359892109 #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
env: | |
ARTIFACTS_DIR: artifacts | |
GH_TOKEN: ${{ github.token }} | |
UNIT_TEST_DIR: test_results | |
VJER_ENV: development | |
jobs: | |
test: | |
uses: arisilon/shared-actions/.github/workflows/vjer.yml@released | |
with: | |
action: test | |
os: ${{ matrix.os }} | |
python-version: ${{ matrix.python-version }} | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
python-version: | |
- "3.12" | |
- "3.13" | |
publish-test-results: | |
name: "Publish Tests Results" | |
needs: test | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
if: always() | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: ${{ env.UNIT_TEST_DIR }} | |
- name: Publish Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
with: | |
files: "${{ env.UNIT_TEST_DIR }}/**/*.xml" | |
build: | |
needs: test | |
uses: arisilon/shared-actions/.github/workflows/vjer.yml@released | |
with: | |
action: build | |
os: ubuntu-latest | |
python-version: "3.12" | |
use-flit: true | |
install-test: | |
needs: build | |
uses: arisilon/shared-actions/.github/workflows/install-test.yml@released | |
with: | |
os: ${{ matrix.os }} | |
python-version: ${{ matrix.python-version }} | |
test-action: "python -c 'import batcave; print(batcave.__version__)'" | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
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/')) | |
permissions: | |
contents: write | |
id-token: write | |
runs-on: ubuntu-latest | |
environment: pre_release | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.RELEASE_TOKEN }} | |
- 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 }} | |
- name: Run post-publish steps | |
run: vjer pre_release | |
release: | |
needs: pre_release | |
if: (github.event_name != 'pull_request') && ((github.ref_name == 'main') || startsWith(github.ref_name, 'release/')) | |
permissions: | |
contents: write | |
id-token: write | |
runs-on: ubuntu-latest | |
environment: release | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.RELEASE_TOKEN }} | |
- name: Setup Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: "pip" | |
- 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 }}-released | |
path: ${{ env.ARTIFACTS_DIR }} | |
# cSpell:ignore pypa |