-
Notifications
You must be signed in to change notification settings - Fork 28
138 lines (131 loc) · 4.66 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
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# ---------------------------------------------------------------------------
# Copyright the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------
name: release
on:
workflow_dispatch:
push:
branches:
- main
paths:
- '.github/project.yml'
jobs:
release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.repository == 'citrusframework/yaks'
steps:
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
- name: Checkout code
uses: actions/checkout@v4
- name: Cache Go modules
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Cache Maven modules
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2-
- name: Prerequisites
run: |
export OPERATOR_SDK_VERSION=v0.19.4
curl -L https://github.com/operator-framework/operator-sdk/releases/download/${OPERATOR_SDK_VERSION}/operator-sdk-${OPERATOR_SDK_VERSION}-x86_64-linux-gnu -o operator-sdk
chmod a+x operator-sdk
sudo mv operator-sdk /usr/local/bin
- name: Retrieve project metadata
id: metadata
uses: radcortez/project-metadata-action@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
metadata-file-path: '.github/project.yml'
local-file: true
- name: Prepare Release Environment
run: |
VERSION=${{ steps.metadata.outputs.current-version }}
echo "Using VERSION=$VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
git fetch --prune --unshallow
- name: Build
run: |
make VERSION=$VERSION set-version
make VERSION=$VERSION build
make VERSION=$VERSION cross-compile
- name: Check
run: ls -l
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.VERSION }}
release_name: v${{ env.VERSION }}
body: |
YAKS release v${{ env.VERSION }}
To test it, download the client for your OS and run:
```
yaks install
```
draft: false
prerelease: false
- name: Upload Client Linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./yaks-${{ env.VERSION }}-linux-64bit.tar.gz
asset_name: yaks-${{ env.VERSION }}-linux-64bit.tar.gz
asset_content_type: application/tar+gzip
- name: Upload Client Mac
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./yaks-${{ env.VERSION }}-mac-64bit.tar.gz
asset_name: yaks-${{ env.VERSION }}-mac-64bit.tar.gz
asset_content_type: application/tar+gzip
- name: Upload Client Mac arm64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./yaks-${{ env.VERSION }}-mac-arm64bit.tar.gz
asset_name: yaks-${{ env.VERSION }}-mac-arm64bit.tar.gz
asset_content_type: application/tar+gzip
- name: Upload Client Windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./yaks-${{ env.VERSION }}-windows-64bit.tar.gz
asset_name: yaks-${{ env.VERSION }}-windows-64bit.tar.gz
asset_content_type: application/tar+gzip