Add github action release workflow and support for bash #1
Workflow file for this run
This file contains hidden or 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 | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build-linux: | |
| name: Build Linux | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install SQLCipher | |
| run: sudo apt-get install -y libsqlcipher-dev | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22' | |
| - name: Build Linux amd64 | |
| run: | | |
| GOOS=linux GOARCH=amd64 CGO_ENABLED=1 \ | |
| go build -o dist/enveil-linux-amd64 ./cmd/enveil/ | |
| - name: Build Linux arm64 | |
| run: | | |
| sudo apt-get install -y gcc-aarch64-linux-gnu | |
| GOOS=linux GOARCH=arm64 CGO_ENABLED=1 \ | |
| CC=aarch64-linux-gnu-gcc \ | |
| go build -o dist/enveil-linux-arm64 ./cmd/enveil/ | |
| - name: Upload Linux artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-binaries | |
| path: dist/ | |
| build-macos: | |
| name: Build macOS | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install SQLCipher | |
| run: brew install sqlcipher | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22' | |
| - name: Build macOS amd64 | |
| run: | | |
| GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 \ | |
| go build -o dist/enveil-darwin-amd64 ./cmd/enveil/ | |
| - name: Build macOS arm64 | |
| run: | | |
| GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 \ | |
| go build -o dist/enveil-darwin-arm64 ./cmd/enveil/ | |
| - name: Upload macOS artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos-binaries | |
| path: dist/ | |
| release: | |
| name: Create Release | |
| needs: [build-linux, build-macos] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download Linux binaries | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: linux-binaries | |
| path: dist/ | |
| - name: Download macOS binaries | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: macos-binaries | |
| path: dist/ | |
| - name: Create checksums | |
| run: | | |
| cd dist | |
| sha256sum * > checksums.txt | |
| cat checksums.txt | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| dist/enveil-linux-amd64 | |
| dist/enveil-linux-arm64 | |
| dist/enveil-darwin-amd64 | |
| dist/enveil-darwin-arm64 | |
| dist/checksums.txt | |
| generate_release_notes: true |