Skip to content

Commit

Permalink
Added github action for building (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
jarnfast authored Apr 26, 2023
1 parent 801b723 commit 658ca0e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Build and publish release

on:
push:
tags:
- "v*.*.*"

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version-file: go.mod
cache: true
cache-dependency-path: go.sum
- name: Get the version
id: get_version
run: echo VERSION=${GITHUB_REF/refs\/tags\//} >> "$GITHUB_ENV"
- name: Cross compile all
run: make xbuild-all VERSION=${{ env.VERSION }}
- name: Generate checksums
run: make generate-checksums VERSION=${{ env.VERSION }}
# - uses: actions/upload-artifact@v3
# with:
# name: xbinaries
# path: bin/${{ env.VERSION }}/*
# if-no-files-found: error
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
LICENSE
bin/${{ env.VERSION }}/signalman-*
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,7 @@ clean:
.PHONY: docker-buildx
docker-buildx:
docker buildx build --build-arg VERSION=$(VERSION) -t signalman-init:latest -f Dockerfile.signalman-init --platform $(PLATFORM)/$(ARCH)$(DOCKERARMVERSION) .

.PHONY: generate-checksums
generate-checksums:
cd bin/$(VERSION) && find . -type f -exec sh -c "sha256sum -b {} > {}.sha256sum" \;

0 comments on commit 658ca0e

Please sign in to comment.