-
Notifications
You must be signed in to change notification settings - Fork 4
67 lines (54 loc) · 2 KB
/
on-release-main.yml
File metadata and controls
67 lines (54 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: release-main
on:
release:
types: [created]
branches: [main, master]
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Set up the environment
uses: ./.github/actions/setup-poetry
- name: Export tag
id: vars
run: echo tag=${GITHUB_REF#refs/tags/} >> $GITHUB_OUTPUT
- name: Build and publish python package
run: |
source .venv/bin/activate
poetry version $RELEASE_VERSION
make build-and-publish
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: ${{ vars.DOCKER_REGISTRY }}
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker images
env:
DOCKER_REGISTRY: ${{ vars.DOCKER_REGISTRY }}
DOCKER_USERNAME: ${{ vars.DOCKER_USERNAME }}
IMAGE_NAME: modsim
TAG: ${{ steps.vars.outputs.tag }}
run: |
TAG=${TAG#v}
IFS='.' read -r MAJOR MINOR PATCH <<< "$TAG"
docker buildx build --platform linux/amd64,linux/arm64 -t ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/$IMAGE_NAME:$TAG -t ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/$IMAGE_NAME:${MAJOR} -t ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/$IMAGE_NAME:${MAJOR}.${MINOR} -t ${DOCKER_REGISTRY}/${DOCKER_USERNAME}/$IMAGE_NAME:latest --push .
deploy-docs:
needs: build-and-publish
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Set up the environment
uses: ./.github/actions/setup-poetry
- name: Deploy documentation
run: poetry run mkdocs gh-deploy --force