-
Notifications
You must be signed in to change notification settings - Fork 31
63 lines (58 loc) · 1.85 KB
/
release.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
54
55
56
57
58
59
60
61
62
63
name: Release
on:
push:
tags: [ v* ]
branches: [ main ]
jobs:
publish-images:
runs-on: ubuntu-latest
strategy:
matrix:
target: [ controller, runner, golang1-17, java16, python3-9, node16, testapi ]
steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
- name: docker build + push
run: |
tag=$(basename $GITHUB_REF)
version=$tag
if [ $tag = "main" ]; then
tag="latest"
version="v0.0.0-latest-0"
fi
docker buildx build . --target ${{matrix.target}} --tag quay.io/argoprojlabs/dataflow-${{matrix.target}}:$tag --push --build-arg VERSION="$version"
publish-release:
runs-on: ubuntu-latest
needs: [ publish-images ]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
with:
# 0 indicates all history for all branches and tags.
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version: 1.17
- run: make manifests TAG=${GITHUB_REF##*/}
- name: Publish release
uses: softprops/action-gh-release@v1
with:
prerelease: ${{ startsWith(github.ref, 'refs/tags/v0') || contains(github.ref, 'rc') }}
files: |
config/default.yaml
config/quick-start.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}