This repository has been archived by the owner on Apr 18, 2024. It is now read-only.
Create Release #106
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
name: Create Release | |
on: | |
workflow_dispatch: {} | |
jobs: | |
semantic-release: | |
runs-on: ubuntu-latest | |
outputs: | |
release-version: ${{ steps.semantic.outputs.release-version }} | |
new-release-published: ${{ steps.semantic.outputs.new-release-published }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: codfish/semantic-release-action@v1 | |
id: semantic | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
test: | |
needs: semantic-release | |
runs-on: ubuntu-latest | |
container: | |
image: flanksource/build-tools:v0.15.1 | |
steps: | |
- uses: actions/checkout@v3 | |
- run: make build | |
binary: | |
needs: semantic-release | |
runs-on: ubuntu-latest | |
container: | |
image: flanksource/build-tools:v0.15.1 | |
strategy: | |
# Github release times out trying to upload all the binaries in a single action | |
# so we split each binary in its own build, and run them serially to prevent dupe releases | |
max-parallel: 1 | |
fail-fast: false | |
matrix: | |
name: | |
- karina.exe | |
- karina | |
- karina_darwin-amd64 | |
- karina_darwin-arm64 | |
- karina_linux-amd64 | |
- karina_linux-arm64 | |
env: | |
VERSION: v${{ needs.semantic-release.outputs.release-version }} | |
TARGET: ./.bin/${{ matrix.name }} | |
steps: | |
- uses: actions/checkout@v3 | |
- run: git config --global --add safe.directory $PWD | |
- run: make $TARGET compress | |
- name: Upload binaries to action run | |
uses: actions/upload-artifact@v2 | |
with: | |
if-no-files-found: ignore | |
name: ${{ matrix.name }} | |
path: ./.bin/${{ matrix.name }} | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ./.bin/${{ matrix.name }} | |
tag: v${{ needs.semantic-release.outputs.release-version }} | |
overwrite: true | |
file_glob: true | |
docker: | |
needs: semantic-release | |
# Only build/push new docker images when there is new version released | |
if: needs.semantic-release.outputs.new-release-published == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Publish to Registry | |
uses: elgohr/Publish-Docker-Github-Action@master | |
with: | |
name: flanksource/karina | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
snapshot: true | |
tags: "latest,v${{ needs.semantic-release.outputs.release-version }}" | |
docs: | |
runs-on: ubuntu-latest | |
container: | |
image: flanksource/build-tools:v0.12.0 | |
steps: | |
- uses: actions/checkout@v3 | |
- run: make build-api-docs build-docs deploy-docs | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} |