forked from Apicurio/apicurio-studio
-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (105 loc) · 4.86 KB
/
release-images.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Release Images
on:
workflow_dispatch: {}
release:
types: [released, prereleased]
env:
PLATFORMS: linux/amd64,linux/arm64
jobs:
release-images:
if: github.repository_owner == 'Apicurio'
runs-on: ubuntu-18.04
steps:
# Open-Source Machine emulator that allows you to emulate multiple CPU architectures on your machine
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
# Docker CLI plugin for extended build capabilities with BuildKit
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Inspect builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Fetch required Details
run: |
touch latestRelease.json && curl https://api.github.com/repos/${GITHUB_REPOSITORY}/releases | jq '.[0]' > latestRelease.json
echo "RELEASE_VERSION=$(cat latestRelease.json | jq -r '.tag_name')" >> $GITHUB_ENV
echo "SOURCE_CODE_URL=$(cat latestRelease.json | jq -r '.zipball_url')" >> $GITHUB_ENV
echo "BRANCH=$(cat latestRelease.json | jq -r '.target_commitish')" >> $GITHUB_ENV
- name: Download Source Code
run: wget -c $SOURCE_CODE_URL && unzip $RELEASE_VERSION && ls -lrt && mv ${{github.repository_owner}}* studio
# We have faced issues in the past where a github release was created from a wrong commit
# This step will ensure that the release was created from the right commit
- name: Verify Project Version
run: |
cd studio
PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
if [[ $PROJECT_VERSION != $RELEASE_VERSION ]]
then
echo "ERROR: Project Version '${PROJECT_VERSION}' does not match with Released Version '${RELEASE_VERSION}'"
exit 1
fi
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Build Project
run: cd studio && mvn clean install -Pprod
- name: Login to DockerHub Registry
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Login to Quay.io Registry
run: docker login -u "${{ secrets.QUAY_USERNAME }}" -p "${{ secrets.QUAY_PASSWORD }}" quay.io
- name: Build and Publish Studio API
uses: docker/build-push-action@v2
with:
context: ./studio/platforms/quarkus/api
file: ./studio/platforms/quarkus/api/Dockerfile
platforms: ${{env.PLATFORMS}}
push: true
tags: |
docker.io/apicurio/apicurio-studio-api:latest
docker.io/apicurio/apicurio-studio-api:latest-release
docker.io/apicurio/apicurio-studio-api:${{env.RELEASE_VERSION}}
quay.io/apicurio/apicurio-studio-api:latest
quay.io/apicurio/apicurio-studio-api:latest-release
quay.io/apicurio/apicurio-studio-api:${{env.RELEASE_VERSION}}
- name: Build and Publish Studio WS
uses: docker/build-push-action@v2
with:
context: ./studio/platforms/quarkus/ws
file: ./studio/platforms/quarkus/ws/Dockerfile
platforms: ${{env.PLATFORMS}}
push: true
tags: |
docker.io/apicurio/apicurio-studio-ws:latest
docker.io/apicurio/apicurio-studio-ws:latest-release
docker.io/apicurio/apicurio-studio-ws:${{env.RELEASE_VERSION}}
quay.io/apicurio/apicurio-studio-ws:latest
quay.io/apicurio/apicurio-studio-ws:latest-release
quay.io/apicurio/apicurio-studio-ws:${{env.RELEASE_VERSION}}
- name: Build and Publish Studio UI
uses: docker/build-push-action@v2
with:
context: ./studio/platforms/quarkus/ui
file: ./studio/platforms/quarkus/ui/Dockerfile
platforms: ${{env.PLATFORMS}}
push: true
tags: |
docker.io/apicurio/apicurio-studio-ui:latest
docker.io/apicurio/apicurio-studio-ui:latest-release
docker.io/apicurio/apicurio-studio-ui:${{env.RELEASE_VERSION}}
quay.io/apicurio/apicurio-studio-ui:latest
quay.io/apicurio/apicurio-studio-ui:latest-release
quay.io/apicurio/apicurio-studio-ui:${{env.RELEASE_VERSION}}
- name: Google Chat Notification
if: ${{ failure() }}
uses: Co-qn/google-chat-notification@releases/v1
with:
name: ${{ github.job }}
url: ${{ secrets.GOOGLE_CHAT_WEBHOOK }}
status: ${{ job.status }}