bump version to 0.2.3 #4
Workflow file for this run
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
# Workflow Requirements: | |
# | |
# 1. In repository Settings -> Actions -> General, ensure "Allow all actions and reusable workflows" is selected, and that under "Workflow permissions", "Read repository contents and packages permissions" is checked. | |
# | |
name: Release on Tag | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.13" | |
- name: Install dependencies | |
run: python -m pip install --upgrade pip && pip install poetry && poetry install | |
- name: Get Version | |
id: get-version | |
run: echo "APP_VERSION=$(poetry version -s)" >> $GITHUB_OUTPUT | |
- name: Ensure tag matches version | |
if: github.ref_name != steps.get-version.outputs.APP_VERSION | |
run: | | |
echo "ERROR: tag name (${{ github.ref_name }}) does not match current version in version.py (${{ steps.get-version.outputs.APP_VERSION }})" | |
exit 2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GHCR | |
run: echo "${{secrets.GITHUB_TOKEN}}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin | |
- name: Docker Build and Push | |
uses: docker/build-push-action@v4 | |
with: | |
push: true | |
sbom: true | |
labels: | | |
org.opencontainers.image.url=https://github.com/${{ github.repository }} | |
org.opencontainers.image.source=https://github.com/${{ github.repository }} | |
org.opencontainers.image.version=${{ github.ref_name }} | |
org.opencontainers.image.revision=${{ github.sha }} | |
tags: | | |
ghcr.io/${{ github.repository }}:${{ github.ref_name }} | |
ghcr.io/${{ github.repository }}:latest | |
- name: Build and publish to pypi | |
uses: JRubics/[email protected] | |
with: | |
pypi_token: ${{ secrets.PYPI_TOKEN }} | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
body: | | |
Release ${{ github.ref_name }}. | |
Docker images: https://github.com/users/jantman/packages/container/package/machine-access-control | |
Python packages: https://pypi.org/project/machine_access_control/ | |
draft: false | |
prerelease: false |