From 2c6aa5f1625f8a5d47f48fc7ccad1714940bdb0f Mon Sep 17 00:00:00 2001 From: Niccolo Raspa Date: Tue, 12 Jul 2022 18:56:23 +0200 Subject: [PATCH] Add release pipeline to create artifacts for osmosis releases (#1644) (#2017) Continues: #1550 ## What is the purpose of the change This PR introduces an automatic release workflow via GitHub Actions to create all the artifacts for an osmosis release. This workflow runs on every new tag or when manually triggered and it creates a release folder with all the osmosis binaries as workflow output. ## Brief Changelog - Introduce automatic release workflow via GitHub Actions ## Testing and Verifying Tested this workflow on a fork: https://github.com/nikever/osmosis/actions/runs/2422822418 The release folder is present in the `Artifacts` section: ![image](https://user-images.githubusercontent.com/6024049/171494127-37d1542c-7c4d-4690-ab6c-a43757b2295d.png) ## Documentation and Release Note - Does this pull request introduce a new feature or user-facing behavior changes? no - Is a relevant changelog entry added to the `Unreleased` section in `CHANGELOG.md`? no - How is the feature or change documented? not applicable --- .github/workflows/release.yml | 35 +++++++++++++++++++++++++++++ contrib/images/osmobuilder/Makefile | 12 ++++------ 2 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000000..caeef52e7c7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +# Create a release folder with the osmosis binaries +# This workflow runs on every new tag or when manually triggered +# It will create a release folder that it's served as an workflow artifact + +name: Release Osmosis + +on: + push: + tags: + - 'v*' + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + steps: + - + name: Check out the repo + uses: actions/checkout@v2 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Launch release process + run: | + make -f contrib/images/osmobuilder/Makefile release + - + name: Upload release folder + uses: actions/upload-artifact@v2 + with: + name: release + path: release diff --git a/contrib/images/osmobuilder/Makefile b/contrib/images/osmobuilder/Makefile index c38c057b5a9..41bcb133c1b 100644 --- a/contrib/images/osmobuilder/Makefile +++ b/contrib/images/osmobuilder/Makefile @@ -37,8 +37,6 @@ build-binary-amd64: create-dockerx-builder --build-arg BUILD_TAGS=$(BUILD_TAGS) \ -t $(IMAGE)-amd64 \ --load \ - --no-cache \ - --progress plain \ -f contrib/images/osmobuilder/Dockerfile . # Get binary from image for amd64 architecture @@ -46,8 +44,8 @@ get-binary-amd64: build-binary-amd64 mkdir -p release/ docker rm -f osmobinary || true docker create -ti --name osmobinary $(IMAGE)-amd64 - docker cp osmobinary:/osmosis/build/osmosisd release/osmosis-$(VERSION)-linux-amd64 - tar -zcvf release/osmosis-$(VERSION)-linux-amd64.tar.gz release/osmosis-$(VERSION)-linux-amd64 + docker cp osmobinary:/osmosis/build/osmosisd release/osmosisd-$(VERSION)-linux-amd64 + tar -zcvf release/osmosisd-$(VERSION)-linux-amd64.tar.gz release/osmosisd-$(VERSION)-linux-amd64 docker rm -f osmobinary # Build image for arm64 architecture @@ -61,8 +59,6 @@ build-binary-arm64: create-dockerx-builder --build-arg BUILD_TAGS=$(BUILD_TAGS) \ -t $(IMAGE)-arm64 \ --load \ - --no-cache \ - --progress plain \ -f contrib/images/osmobuilder/Dockerfile . # Get binary from image for arm64 architecture @@ -70,8 +66,8 @@ get-binary-arm64: build-binary-arm64 mkdir -p release/ docker rm -f osmobinary || true docker create -ti --name osmobinary $(IMAGE)-arm64 - docker cp osmobinary:/osmosis/build/osmosisd release/osmosis-$(VERSION)-linux-arm64 - tar -zcvf release/osmosis-$(VERSION)-linux-arm64.tar.gz release/osmosis-$(VERSION)-linux-arm64 + docker cp osmobinary:/osmosis/build/osmosisd release/osmosisd-$(VERSION)-linux-arm64 + tar -zcvf release/osmosisd-$(VERSION)-linux-arm64.tar.gz release/osmosisd-$(VERSION)-linux-arm64 docker rm -f osmobinary # Calculate sha