-
Notifications
You must be signed in to change notification settings - Fork 28
127 lines (119 loc) · 4.54 KB
/
nightly.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
# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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: nightly
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 1"
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@v3
- 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: Prepare Release Environment
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }}
run: |
VERSION=$(make snapshot-version | sed s/-SNAPSHOT/-$(date +%Y%m%d%H%M)/)
echo "Using VERSION=$VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
IMAGE_NAME=docker.io/yaks/yaks
echo "Using IMAGE_NAME=$IMAGE_NAME"
echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV
git fetch --prune --unshallow
docker login $DOCKER_REGISTRY -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- name: Build
run: |
make VERSION=$VERSION IMAGE_NAME=$IMAGE_NAME release-nightly
- 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: ${{ env.VERSION }}
release_name: Release ${{ env.VERSION }}
body: |
YAKS snapshot build for testing (unstable).
To test it, download the client for your OS and run:
```
yaks install
```
draft: false
prerelease: true
- 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 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