Skip to content

Commit

Permalink
Add release pipeline to create artifacts for osmosis releases (#1644) (
Browse files Browse the repository at this point in the history
…#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
  • Loading branch information
Niccolo Raspa authored Jul 12, 2022
1 parent 2f136d8 commit 2c6aa5f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 8 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 4 additions & 8 deletions contrib/images/osmobuilder/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,15 @@ 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
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
Expand All @@ -61,17 +59,15 @@ 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
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
Expand Down

0 comments on commit 2c6aa5f

Please sign in to comment.