Skip to content

Accept "token" as access token field name on login #85

Accept "token" as access token field name on login

Accept "token" as access token field name on login #85

Workflow file for this run

name: Publish Docker image and pypi package
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
jobs:
create_release:
name: Push to pypi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
sudo apt-get install libblas3 liblapack3 liblapack-dev libblas-dev gfortran libatlas-base-dev
- name: Build and publish
run: |
export PSACC_VERSION=$(git describe --tags --abbrev=0)
poetry version ${PSACC_VERSION}
poetry build
poetry publish --username __token__ --password ${{ secrets.PYPI_TOKEN }}
mv dist/psa_car_controller-${PSACC_VERSION:1}-py3-none-any.whl dist/psa_car_controller-0.0.0-py3-none-any.whl
- uses: actions/upload-artifact@v4
with:
name: wheel-package
path: dist/psa_car_controller-0.0.0-py3-none-any.whl
push_to_registry:
needs: create_release
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=flobz/psa_car_controller
VERSION=edge
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
MINOR_VERSION=${VERSION%.*}
MAJOR=${MINOR_VERSION%.*}
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${MINOR_VERSION},${DOCKER_IMAGE}:${MAJOR},${DOCKER_IMAGE}:latest"
else
TAGS="${DOCKER_IMAGE}:${VERSION}"
fi
echo ::set-output name=tags::${TAGS}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v4
- name: Check out the repo
uses: actions/checkout@v6
- uses: actions/download-artifact@v4
with:
name: wheel-package
path: dist/psa_car_controller-0.0.0-py3-none-any.whl
- name: Login to DockerHub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v7
with:
context: .
push: true
tags: ${{ steps.prep.outputs.tags }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
update_ha_config:
needs: push_to_registry
name: Update psacc-ha version
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, 'b')
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/update-ha-config
with:
gh_token: ${{ secrets.GH_PAT }}
version: ${{ github.ref_name }}
branch: 'main'
message: "chore: bump version to ${{ github.ref_name }}"
update_ha_config_beta:
needs: push_to_registry
name: Update psacc-ha beta version
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'b')
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/update-ha-config
with:
gh_token: ${{ secrets.GH_PAT }}
version: ${{ github.ref_name }}
branch: 'beta'
message: "chore: bump beta version to ${{ github.ref_name }}"