-
Notifications
You must be signed in to change notification settings - Fork 26
60 lines (57 loc) · 2.77 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
# This workflow publish release versions of images.
name: Release workflow
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set QUAY Organization
id: quay-organization
run: echo "::set-output name=name::$( [ -z '${{ secrets.quay_organization }}' ] && echo 'rhoas' || echo '${{ secrets.quay_organization }}')"
- name: Set Time
id: time
run: echo "::set-output name=time::$( date +%Y-%m-%d\ %H:%M:%S )"
- uses: actions/checkout@v2
- name: Bump version
run: 'FORCE_VERSION=${GITHUB_REF##*/} olm/autoupdate.sh ${{ secrets.quay_robotaccount }} ${{ secrets.quay_robottoken }} ${{ steps.quay-organization.outputs.name }} "${{steps.time.outputs.time}}"'
- name: Load version number
id: version-number
run: echo "::set-output name=version::$(cat olm/version)"
- name: Commit updated version
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Quay.io
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.quay_robotaccount }}
password: ${{ secrets.quay_robottoken }}
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
server-id: github # value of repository/id field of the pom.xml
server-username: CI_USER # env variable name for username
server-password: CI_PASSWORD # env variable name for GitHub Personal Access Token
- name: Build and run Unit tests
run: mvn install --file pom.xml --no-transfer-progress -Dquarkus.container-image.username=${{ secrets.quay_robotaccount }} -Dquarkus.container-image.password=${{ secrets.quay_robottoken }} -Dquarkus.container-image.build=true -Dquarkus.container-image.tag=${{ steps.version-number.outputs.version }} -Dquarkus.container-image.push=true -Dquarkus.container-image.username=${{ secrets.quay_robotaccount}} -Dquarkus.container-image.password=${{ secrets.quay_robottoken}} -Dquarkus.container-image.group=${{ steps.quay-organization.outputs.name }}
env:
CI_USER: ${{ secrets.CI_USER }}
CI_PASSWORD: ${{ secrets.CI_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: olm
file: ./olm/index.Dockerfile
platforms: linux/amd64
push: true
tags: quay.io/${{ steps.quay-organization.outputs.name }}/service-operator-registry:autolatest
build-args: |
QUAY_USER=${{ secrets.quay_robotaccount }}
QUAY_PASSWORD=${{ secrets.quay_robottoken }}
QUAY_ORGANIZATION=${{ steps.quay-organization.outputs.name }}
VERSION=${{ steps.version-number.outputs.version }}