-
Notifications
You must be signed in to change notification settings - Fork 182
68 lines (63 loc) · 2.02 KB
/
release.yaml
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
68
name: Release
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+rc[0-9]+'
jobs:
release-to-pypi:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: "3.8"
- name: Build wheels
run: pdm build --no-sdist
env:
PDM_BUILD_SCM_VERSION: ${{github.ref_name}}
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
build-docker-image:
runs-on: ubuntu-latest
needs:
- release-to-pypi
steps:
- uses: actions/checkout@v4
- run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
- run: echo "Release new docker image with tag ${{ env.RELEASE_VERSION }}"
- name: Building the Docker image
uses: nick-invision/retry@v2.4.0
env:
DOCKER_TAG: ${{ env.RELEASE_VERSION }}
with:
timeout_minutes: 10
max_attempts: 3
command: |
docker build --build-arg ctkversion=${DOCKER_TAG} -t chaostoolkit/chaostoolkit .
docker tag chaostoolkit/chaostoolkit:latest chaostoolkit/chaostoolkit:${DOCKER_TAG}
- name: Publishing to the Docker repository
env:
DOCKER_TAG: ${{ env.RELEASE_VERSION }}
DOCKER_USER_NAME: chaostoolkit
DOCKER_PWD: ${{ secrets.DOCKER_PWD }}
run: |
docker login -u ${DOCKER_USER_NAME} -p ${DOCKER_PWD}
docker push chaostoolkit/chaostoolkit:$DOCKER_TAG
docker push chaostoolkit/chaostoolkit:latest
create-gh-release:
runs-on: ubuntu-latest
steps:
- name: Create Release
uses: actions/create-release@latest
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 }}
draft: false
prerelease: false