CLI version 0.0.6 #34
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: CI | |
on: | |
push: | |
branches: | |
- main | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build-cli: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
# fetch all history to get the commits required for tagging releases | |
fetch-depth: 0 | |
# use a PAT instead of GITHUB_TOKEN to push the tags to trigger the release worflow when pushing tags | |
# https://stackoverflow.com/questions/75348291/how-to-trigger-github-actions-workflow-whenever-a-new-tag-was-pushed | |
token: ${{secrets.CLASSIC_REPO_TOKEN}} | |
- name: Install babashka | |
run: | | |
bash < <(curl -s https://raw.githubusercontent.com/babashka/babashka/master/install) | |
- name: Build standalone cli | |
run: | | |
./standalone-build.sh target | |
- name: Build bb dependent launcher | |
id: portable-build | |
run: | | |
./build.sh target | |
echo "sha256=$(cat target/garden.tar.gz.sha256)" >> $GITHUB_OUTPUT | |
- name: Upload build | |
uses: actions/upload-artifact@v3 | |
with: | |
path: target/* | |
- name: Tag releases | |
# find all commits since last version tag that touch resources/VERSION and tag them with a version based on the contents of resources/VERSION | |
run: | | |
lastTaggedRelease=$(git describe --match="v*" --tags --abbrev=0 || git rev-list --max-parents=0 HEAD) | |
commits=$(git log --format=%H "$lastTaggedRelease.." resources/VERSION) | |
[ -z $commits ] || echo $commits | while read commit; do | |
version="$(git show "$commit:resources/VERSION")" | |
git tag "v$version" "$commit" | |
done | |
git push --tags |