Removed unused file.go ref in build cmds #13
Workflow file for this run
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: Release Baobud | |
on: | |
push: | |
tags: | |
- "v*" | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build-and-test: | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
platform: linux | |
arch: amd64 | |
bao_url: https://github.com/openbao/openbao/releases/download/v2.0.1/bao_2.0.1_linux_amd64.deb | |
# - os: ubuntu-latest | |
# platform: linux | |
# arch: arm64 | |
# bao_url: https://github.com/openbao/openbao/releases/download/v2.0.1/bao_2.0.1_linux_arm64.deb | |
# - os: macos-latest | |
# platform: darwin | |
# arch: arm64 | |
# bao_url: https://github.com/openbao/openbao/releases/download/v2.0.1/bao_2.0.1_Darwin_arm64.tar.gz | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.21" | |
- name: Install OpenBao | |
run: | | |
if [[ "${{ matrix.bao_url }}" == *.deb ]]; then | |
curl -Lo openbao.deb ${{ matrix.bao_url }} | |
sudo dpkg -i openbao.deb | |
rm openbao.deb | |
else | |
curl -Lo openbao.tar.gz ${{ matrix.bao_url }} | |
tar xzf openbao.tar.gz | |
sudo mv bao /usr/local/bin/ | |
rm openbao.tar.gz | |
fi | |
- name: Run tests | |
run: make test | |
- name: Build | |
env: | |
GOARCH: ${{ matrix.arch }} | |
GOOS: ${{ matrix.platform }} | |
run: | | |
mkdir -p bin | |
go build -ldflags="-s -w" -o bin/baobud-${{ matrix.platform }}-${{ matrix.arch }} cmd/main.go | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: baobud-${{ matrix.platform }}-${{ matrix.arch }} | |
path: bin/baobud-${{ matrix.platform }}-${{ matrix.arch }} | |
release: | |
needs: build-and-test | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download all artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: bin | |
- name: Prepare artifacts for release | |
run: | | |
cd bin | |
chmod +x */baobud-* | |
mv baobud-linux-amd64/baobud-linux-amd64 ./ | |
mv baobud-linux-arm64/baobud-linux-arm64 ./ | |
mv baobud-darwin-amd64/baobud-darwin-amd64 ./ | |
mv baobud-darwin-arm64/baobud-darwin-arm64 ./ | |
- name: Generate checksums | |
run: | | |
cd bin | |
sha256sum baobud-* > checksums.txt | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
bin/baobud-linux-amd64 | |
bin/baobud-linux-arm64 | |
bin/baobud-darwin-amd64 | |
bin/baobud-darwin-arm64 | |
bin/checksums.txt | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |