Skip to content

Create fortinet_transformer.py #255

Create fortinet_transformer.py

Create fortinet_transformer.py #255

Workflow file for this run

name: 🔖 Bump version
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [master, next_release/*, release/*]
env:
CONTAINER_NAME: ubiqube/msa2-python-sdk-installer
REVIEWERS: msa-api
jobs:
run-tests:
name: Run unittest
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: [3.12]
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
DIR=$(pwd)
cd ../
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f ${DIR}/requirements.txt ]; then pip install -r ${DIR}/requirements.txt ; fi
if [ -f ${DIR}/requirements-dev.txt ]; then pip install -r ${DIR}/requirements-dev.txt ; fi
- name: Test with pytest
run: |
./run_tests quiet
bump-version:
name: Bump version
runs-on: ubuntu-latest
needs: run-tests
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies
run: |
DIR=$(pwd)
cd ../
python -m pip install --upgrade pip
python -m pip install bump2version
cd ${DIR}
bump2version patch msa_sdk/__init__.py
- name: Extract version
id: extract_version
run: |
echo current_version=$(grep -oP '__version__ = "\K[^"]+' msa_sdk/__init__.py) >> $GITHUB_ENV
- name: Commit bump version
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 🔖 Commit bump version ${{ env.current_version }}
commit_user_name: qa4ubiqube (bot)
commit_user_email: qa@ubiqube.com
commit_author: qa4ubiqube <qa@ubiqube.com>
push_options: --force
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: "${{ env.CONTAINER_NAME }}"
tags: |
type=sha,format=long
latest
- name: Build Docker image and publish to Docker Hub
id: push
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
provenance: mode=max
sbom: true
tags: "${{ steps.meta.outputs.tags }}"
labels: ${{ steps.meta.outputs.labels }}
- name: Set latest commit message as env variable
run: echo "LATEST_COMMIT_MESSAGE=$(git log -1 --oneline ${{ github.event.after }} | sed 's/"/\\"/g')" >> $GITHUB_ENV
- name: Notify msa-docker repo about updated ${{ env.CONTAINER_NAME }} Docker image
uses: benc-uk/workflow-dispatch@v1
with:
token: ${{ secrets.MSA_DOCKER_REPO_ACCESS_TOKEN }}
ref: ${{ github.ref_name || 'master' }}
repo: ubiqube/msa-docker
workflow: create-pr.yml
inputs: |-
{
"image_name": "${{ env.CONTAINER_NAME }}",
"image_tag": "sha-${{ github.sha }}",
"latest_commit_message": "${{ env.LATEST_COMMIT_MESSAGE }}",
"team_reviewers": "${{ env.REVIEWERS }}",
"branch_name": "${{ github.ref_name }}"
}