nightly #612
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --------------------------------------------------------------------------- | |
# 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: 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@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: 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 |