v0.3.2 #21
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 | |
on: | |
release: | |
types: | |
- created | |
env: | |
# Common versions | |
GO_VERSION: '1.21' | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
build_and_upload: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
TARGETS: [ linux/amd64, darwin/amd64, windows/amd64, linux/arm64, darwin/arm64 ] | |
env: | |
GO_BUILD_ENV: GO111MODULE=on CGO_ENABLED=0 | |
DIST_DIRS: find * -type d -exec | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Get release | |
id: get_release | |
uses: bruceadams/[email protected] | |
- name: Get matrix | |
id: get_matrix | |
run: | | |
TARGETS=${{matrix.TARGETS}} | |
echo ::set-output name=OS::${TARGETS%/*} | |
echo ::set-output name=ARCH::${TARGETS#*/} | |
- name: Build | |
run: | | |
${{ env.GO_BUILD_ENV }} GOOS=${{ steps.get_matrix.outputs.OS }} GOARCH=${{ steps.get_matrix.outputs.ARCH }} \ | |
go build \ | |
-o _bin/bend-ingest-kafka/${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}/bend-ingest-kafka | |
- name: Compress | |
run: | | |
cd _bin/bend-ingest-kafka && \ | |
${{ env.DIST_DIRS }} cp ../../LICENSE {} \; && \ | |
${{ env.DIST_DIRS }} cp ../../README.md {} \; && \ | |
${{ env.DIST_DIRS }} tar -zcf bend-ingest-kafka-{}.tar.gz {} \; && \ | |
cd .. && \ | |
sha256sum bend-ingest-kafka/bend-ingest-kafka-* >> sha256-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}.txt \ | |
- name: Upload bend-ingest-kafka tar.gz | |
uses: actions/[email protected] | |
with: | |
upload_url: ${{ steps.get_release.outputs.upload_url }} | |
asset_path: ./_bin/bend-ingest-kafka/bend-ingest-kafka-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}.tar.gz | |
asset_name: bend-ingest-kafka-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}-${{ steps.get_release.outputs.tag_name }}.tar.gz | |
asset_content_type: binary/octet-stream | |
- name: Post sha256 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sha256sums | |
path: ./_bin/sha256-${{ steps.get_matrix.outputs.OS }}-${{ steps.get_matrix.outputs.ARCH }}.txt | |
retention-days: 1 | |
upload-sha256sums: | |
needs: build_and_upload | |
runs-on: ubuntu-latest | |
name: upload-sha256sums | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get release | |
id: get_release | |
uses: bruceadams/[email protected] | |
- name: Download artifacts | |
uses: actions/[email protected] | |
with: | |
pattern: sha256sums-* | |
merge-multiple: true | |
path: sha256sums | |
- shell: bash | |
run: | | |
cat sha256sums/*.txt > sha256sums.txt | |
- name: Upload Checksums | |
uses: actions/[email protected] | |
with: | |
upload_url: ${{ steps.get_release.outputs.upload_url }} | |
asset_path: sha256sums.txt | |
asset_name: sha256sums-${{ steps.get_release.outputs.tag_name }}.txt | |
asset_content_type: text/plain |