Skip to content

Commit

Permalink
Problem: released binary don't contain needed dynamic libraries for L…
Browse files Browse the repository at this point in the history
…inux (#793) (#781)

Solution:
- flakify chain-maind project
- port nix releaser from cronos project
  • Loading branch information
yihuang authored Jul 4, 2022
1 parent 876f423 commit f1bc423
Show file tree
Hide file tree
Showing 24 changed files with 621 additions and 668 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/goreleaser.yml

This file was deleted.

25 changes: 12 additions & 13 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
- uses: cachix/install-nix-action@v14
- uses: cachix/install-nix-action@v15
- uses: cachix/cachix-action@v10
with:
name: crypto-com
Expand All @@ -29,16 +29,15 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
- uses: cachix/install-nix-action@v14
- uses: cachix/install-nix-action@v15
- uses: cachix/cachix-action@v10
with:
name: crypto-com
# github don't pass secrets for pull request from fork repos,
# in that case the push is disabled naturally.
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
skipPush: ${{github.event_name == 'pull_request'}}
- name: Run integration tests
run: make nix-integration-test
- name: Build chain utils
run: nix-build -A chain-utils-testnet
- name: Upload coverage report
uses: codecov/codecov-action@v1
with:
Expand All @@ -61,7 +60,7 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
- uses: cachix/install-nix-action@v14
- uses: cachix/install-nix-action@v15
- uses: cachix/cachix-action@v10
with:
name: crypto-com
Expand All @@ -83,7 +82,7 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
- uses: cachix/install-nix-action@v14
- uses: cachix/install-nix-action@v15
- uses: cachix/cachix-action@v10
with:
name: crypto-com
Expand All @@ -105,7 +104,7 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
- uses: cachix/install-nix-action@v14
- uses: cachix/install-nix-action@v15
- uses: cachix/cachix-action@v10
with:
name: crypto-com
Expand All @@ -127,7 +126,7 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
- uses: cachix/install-nix-action@v14
- uses: cachix/install-nix-action@v15
- uses: cachix/cachix-action@v10
with:
name: crypto-com
Expand All @@ -149,7 +148,7 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
- uses: cachix/install-nix-action@v14
- uses: cachix/install-nix-action@v15
- uses: cachix/cachix-action@v10
with:
name: crypto-com
Expand All @@ -171,7 +170,7 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
- uses: cachix/install-nix-action@v14
- uses: cachix/install-nix-action@v15
- uses: cachix/cachix-action@v10
with:
name: crypto-com
Expand All @@ -193,7 +192,7 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
- uses: cachix/install-nix-action@v14
- uses: cachix/install-nix-action@v15
- uses: cachix/cachix-action@v10
with:
name: crypto-com
Expand All @@ -216,7 +215,7 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: true
- uses: cachix/install-nix-action@v14
- uses: cachix/install-nix-action@v15
- uses: cachix/cachix-action@v10
with:
name: crypto-com
Expand Down
85 changes: 85 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: release

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

permissions:
contents: write

jobs:
nix-bundle-x86_64:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
environment: release
steps:
- uses: cachix/install-nix-action@v16
with:
nix_path: nixpkgs=channel:nixos-21.11
- uses: cachix/cachix-action@v10
with:
name: crypto-com
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
- name: build linux/mac x86_64 binaries
run: |
PLATFORM="$(uname -s)_x86_64"
BUILD_TYPE="tarball"
FLAKE="github:${GITHUB_REPOSITORY}/${GITHUB_REF_NAME}"
nix build -L ${FLAKE}#chain-maind-$BUILD_TYPE
cp result chain-main_${GITHUB_REF_NAME:1}_${PLATFORM}.tar.gz
nix-env -i coreutils -f '<nixpkgs>'
sha256sum *.tar.gz > "checksums-$PLATFORM.txt"
echo 'FILES<<EOF' >> $GITHUB_ENV
ls -1 *.tar.gz >> $GITHUB_ENV
ls -1 checksums-*.txt >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
cat $GITHUB_ENV
- name: upload linux/mac x86_64 binaries
uses: softprops/action-gh-release@v1
with:
draft: true
files: "${{ env.FILES }}"

nix-bundle-aarch64-linux:
needs: ["nix-bundle-x86_64"]
runs-on: ubuntu-latest
environment: release
steps:
- uses: cachix/install-nix-action@v16
- run: |
DEBIAN_FRONTEND=noninteractive
sudo apt-get update -q -y && sudo apt-get install -q -y qemu-system-aarch64 qemu-efi binfmt-support qemu-user-static
mkdir -p ~/.config/nix
sudo bash -c "echo system-features = aarch64-linux arm-linux >> /etc/nix/nix.conf"
- uses: cachix/cachix-action@v10
with:
name: crypto-com
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
- name: build linux arm64 binaries
env:
PLATFORM: Linux_arm64
run: |
BUILD_TYPE="tarball"
FLAKE="github:${GITHUB_REPOSITORY}/${GITHUB_REF_NAME}"
nix build -L --extra-platforms aarch64-linux ${FLAKE}#packages.aarch64-linux.chain-maind-$BUILD_TYPE
cp result chain-main_${GITHUB_REF_NAME:1}_${PLATFORM}.tar.gz
sha256sum *.tar.gz > checksums-$PLATFORM.txt
echo 'FILES<<EOF' >> $GITHUB_ENV
ls -1 *.tar.gz >> $GITHUB_ENV
ls -1 checksums-*.txt >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
cat $GITHUB_ENV
- name: upload linux arm64 binaries
uses: softprops/action-gh-release@v1
with:
draft: true
files: "${{ env.FILES }}"
119 changes: 0 additions & 119 deletions .goreleaser.yml

This file was deleted.

Loading

0 comments on commit f1bc423

Please sign in to comment.