bedrocktool/.github/workflows/build.yml
2022-08-22 22:32:19 +02:00

56 lines
1.3 KiB
YAML

name: ci-build
on:
push
jobs:
build:
name: Build
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: '1.19'
check-latest: true
cache: true
- name: decrypt
if: ${{ !env.ACT }}
run: |
sudo apt update -y
sudo apt install git-crypt xxd -y
echo ${REPO_KEY} | xxd -r -p > ../bedrock-repo-key.key
git-crypt unlock ../bedrock-repo-key.key
rm ../bedrock-repo-key.key
env:
REPO_KEY: ${{ secrets.REPO_KEY }}
- run: go get
- name: build
run: make -j
- uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag
- name: Create Release
if: startsWith(github.ref, 'refs/tags/v')
uses: ncipollo/release-action@v1.10.0
with:
allowUpdates: true
artifacts: dist/*
tag: ${{ steps.get-latest-tag.outputs.tag }}
- name: update latest Release
if: "!(startsWith(github.ref, 'refs/tags/v'))"
uses: ncipollo/release-action@v1.10.0
with:
allowUpdates: true
artifacts: dist/*
tag: latest
prerelease: true