Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic creation of builds on push tags #97

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "Release"

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
draft-release:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Copy Binary
run: |
make build-reproducible-all
make build-testnet-reproducible-all

- name: Draft Release
uses: softprops/action-gh-release@v1
with:
draft: true
files: |
kid_mainnet_linux_amd64
kid_mainnet_linux_arm64
kid_testnet_linux_amd64
kid_testnet_linux_arm64
kid_sha256.txt
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ build-reproducible-generic: go.sum
--build-arg VERSION="$(VERSION)" \
-f Dockerfile .
$(DOCKER) create -ti --name $(subst /,-,latest-build-$(PLATFORM)) latest-build-$(PLATFORM) kid
mkdir -p $(CURDIR)/build/$(NETWORK)/$(PLATFORM)/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove the build dir entirely ? 

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything is now built at the root for the shasum to display correct path.
I was highly inspired by horcrux's setup cf: https://github.com/strangelove-ventures/horcrux/blob/03f565d67bb5394a4b3017a1adb00561d5297724/.github/workflows/release.yml#L63

$(DOCKER) cp -a $(subst /,-,latest-build-$(PLATFORM)):/usr/local/bin/kid $(CURDIR)/build/$(NETWORK)/$(PLATFORM)/kid
$(DOCKER) cp -a $(subst /,-,latest-build-$(PLATFORM)):/usr/local/bin/kid "$(CURDIR)/kid_$(shell echo '$(NETWORK)' | tr '[:upper:]' '[:lower:]')_$(subst /,_,$(PLATFORM))"
sha256sum kid_$(shell echo '$(NETWORK)' | tr '[:upper:]' '[:lower:]')_$(subst /,_,$(PLATFORM)) >> ./kid_sha256.txt

build-linux: go.sum
LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build
Expand Down
Loading