Fix: Fixed Policy Set Controller Conditions Template #275
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: Release | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
pull_request: | |
jobs: | |
format: | |
name: Check Code Format | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- name: Install Poetry | |
uses: Gr1N/setup-poetry@v9 | |
with: | |
poetry-version: 1.8.3 | |
- name: Get poetry cache directory | |
id: poetry-cache | |
run: echo "dir=$(poetry config cache-dir)" >> $GITHUB_OUTPUT | |
- name: Cache poetry dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.poetry-cache.outputs.dir }} | |
key: ${{ runner.os }}-poetry-3.9-${{ hashFiles('**/poetry.lock') }} | |
restore-keys: | | |
${{ runner.os }}-poetry-3.9- | |
- name: Install dependencies | |
run: poetry install | |
- name: Format Code with black | |
run: poetry run make format | |
- name: Check formatting with black | |
run: poetry run make check-format | |
release: | |
name: Release | |
if: github.event_name == 'push' && github.ref != 'refs/heads/develop' | |
needs: [format] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- name: Install Poetry | |
uses: Gr1N/setup-poetry@v9 | |
with: | |
poetry-version: 1.8.3 | |
- name: Get poetry cache directory | |
id: poetry-cache | |
run: echo "dir=$(poetry config cache-dir)" >> $GITHUB_OUTPUT | |
- name: Cache poetry dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.poetry-cache.outputs.dir }} | |
key: ${{ runner.os }}-poetry-3.9-${{ hashFiles('**/poetry.lock') }} | |
restore-keys: | | |
${{ runner.os }}-poetry-3.9- | |
- name: Install dependencies | |
run: poetry install | |
- name: Import GPG key | |
id: import_gpg | |
uses: crazy-max/ghaction-import-gpg@v6 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.PASSPHRASE }} | |
- name: Create release and publish | |
id: release | |
uses: cycjimmy/semantic-release-action@v2 | |
with: | |
semantic_version: 17.1.1 | |
extra_plugins: | | |
conventional-changelog-conventionalcommits@^4.4.0 | |
@semantic-release/git@^9.0.0 | |
@semantic-release/exec@^5.0.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} | |
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }} |