Skip to content

BatCave Build and Release - 12573729727 #7

BatCave Build and Release - 12573729727

BatCave Build and Release - 12573729727 #7

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:
UNIT_TEST_DIR: test_results
ARTIFACTS_DIR: artifacts
GH_TOKEN: ${{ github.token }}
VJER_ENV: development
jobs:
test:
uses: tardis4500/shared-actions/.github/workflows/vjer.yml@main
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: tardis4500/shared-actions/.github/workflows/vjer.yml@main
with:
action: build
os: ubuntu-latest
python-version: "3.12"
use-flit: true
install-test:
needs: build
uses: tardis4500/shared-actions/.github/workflows/install-test.yml@main
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:
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
if: (github.event_name != 'pull_request') && ((github.ref_name == 'main') || startsWith(github.ref_name, 'release/'))
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 }}