-
Notifications
You must be signed in to change notification settings - Fork 4
53 lines (52 loc) · 1.53 KB
/
publish.yml
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
name: Build and publish
on:
pull_request:
types: [closed]
branches:
- master
- develop
- beta
- stable
- 'v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
if: github.event.pull_request.merged
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python 3.11
uses: actions/setup-python@v1
with:
python-version: 3.11
- name: Build and publish container
run: |
export BRANCH=${GITHUB_REF##*/}
export VERSION=$(cat VERSION)
echo "Branch: $BRANCH"
echo "Base version: $VERSION"
export VERSION=$(bash ./helper-scripts/calculate_version.sh)
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Version $VERSION"
export RELEASE=true
( test $BRANCH = "stable" && export PRERELEASE=false ) || export PRERELEASE=true
echo "PRERELEASE=$PRERELEASE" >> $GITHUB_ENV
echo "RELEASE=$RELEASE" >> $GITHUB_ENV
export CONTAINER_NAME="admin"
bash ./helper-scripts/build_and_publish.sh
- name: Checkout code
uses: actions/checkout@master
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
release_name: ${{ env.VERSION }}
draft: false
prerelease: ${{ env.PRERELEASE }}