Fix goreleaser release workflow

This commit is contained in:
Ian Davis 2022-11-03 14:51:20 +00:00
parent 7afa5c9255
commit ecef0b6361
3 changed files with 22 additions and 50 deletions

View File

@ -67,7 +67,7 @@ commands:
- run: go version - run: go version
- run: - run:
name: Install dependencies with Homebrew name: Install dependencies with Homebrew
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config goreleaser/tap/goreleaser-pro coreutils jq hwloc command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config coreutils jq hwloc
- run: - run:
name: Install Rust name: Install Rust
command: | command: |
@ -91,28 +91,12 @@ commands:
install_ipfs: install_ipfs:
steps: steps:
- run: | - run: |
apt update curl -O https://dist.ipfs.tech/kubo/v0.16.0/kubo_v0.16.0_linux-amd64.tar.gz
apt install -y wget tar -xvzf kubo_v0.16.0_linux-amd64.tar.gz
wget https://github.com/ipfs/go-ipfs/releases/download/v0.12.2/go-ipfs_v0.12.2_linux-amd64.tar.gz
wget https://github.com/ipfs/go-ipfs/releases/download/v0.12.2/go-ipfs_v0.12.2_linux-amd64.tar.gz.sha512
if [ "$(sha512sum go-ipfs_v0.12.2_linux-amd64.tar.gz)" != "$(cat go-ipfs_v0.12.2_linux-amd64.tar.gz.sha512)" ]
then
echo "ipfs failed checksum check"
exit 1
fi
tar -xf go-ipfs_v0.12.2_linux-amd64.tar.gz
mv go-ipfs/ipfs /usr/local/bin/ipfs
chmod +x /usr/local/bin/ipfs
install_ipfs_macos:
steps:
- run: |
curl -O https://dist.ipfs.io/kubo/v0.14.0/kubo_v0.14.0_darwin-amd64.tar.gz
tar -xvzf kubo_v0.14.0_darwin-amd64.tar.gz
pushd kubo pushd kubo
sudo bash install.sh sudo bash install.sh
popd popd
rm -rf kubo/ rm -rf kubo
rm kubo_v0.14.0_darwin-amd64.tar.gz
git_fetch_all_tags: git_fetch_all_tags:
steps: steps:
- run: - run:
@ -339,7 +323,6 @@ jobs:
- prepare: - prepare:
linux: false linux: false
darwin: true darwin: true
- install_ipfs_macos
- restore_cache: - restore_cache:
name: restore cargo cache name: restore cargo cache
key: v3-go-deps-{{ arch }}-{{ checksum "~/go/src/github.com/filecoin-project/lotus/go.sum" }} key: v3-go-deps-{{ arch }}-{{ checksum "~/go/src/github.com/filecoin-project/lotus/go.sum" }}
@ -368,7 +351,6 @@ jobs:
- prepare: - prepare:
linux: false linux: false
darwin: true darwin: true
- install_ipfs_macos
- restore_cache: - restore_cache:
name: restore cargo cache name: restore cargo cache
key: v3-go-deps-{{ arch }}-{{ checksum "~/go/src/github.com/filecoin-project/lotus/go.sum" }} key: v3-go-deps-{{ arch }}-{{ checksum "~/go/src/github.com/filecoin-project/lotus/go.sum" }}
@ -394,7 +376,7 @@ jobs:
when: always when: always
- run: - run:
name: cleanup homebrew name: cleanup homebrew
command: HOMEBREW_NO_AUTO_UPDATE=1 brew uninstall pkg-config goreleaser/tap/goreleaser-pro coreutils jq hwloc command: HOMEBREW_NO_AUTO_UPDATE=1 brew uninstall pkg-config coreutils jq hwloc
when: always when: always
release: release:
@ -405,6 +387,12 @@ jobs:
description: should this release actually publish it's artifacts? description: should this release actually publish it's artifacts?
type: boolean type: boolean
steps: steps:
- checkout
- run: |
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list
sudo apt update
sudo apt install goreleaser-pro
- install_ipfs
- attach_workspace: - attach_workspace:
at: /tmp/workspace at: /tmp/workspace
- when: - when:

View File

@ -67,7 +67,7 @@ commands:
- run: go version - run: go version
- run: - run:
name: Install dependencies with Homebrew name: Install dependencies with Homebrew
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config goreleaser/tap/goreleaser-pro coreutils jq hwloc command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config coreutils jq hwloc
- run: - run:
name: Install Rust name: Install Rust
command: | command: |
@ -91,28 +91,12 @@ commands:
install_ipfs: install_ipfs:
steps: steps:
- run: | - run: |
apt update curl -O https://dist.ipfs.tech/kubo/v0.16.0/kubo_v0.16.0_linux-amd64.tar.gz
apt install -y wget tar -xvzf kubo_v0.16.0_linux-amd64.tar.gz
wget https://github.com/ipfs/go-ipfs/releases/download/v0.12.2/go-ipfs_v0.12.2_linux-amd64.tar.gz
wget https://github.com/ipfs/go-ipfs/releases/download/v0.12.2/go-ipfs_v0.12.2_linux-amd64.tar.gz.sha512
if [ "$(sha512sum go-ipfs_v0.12.2_linux-amd64.tar.gz)" != "$(cat go-ipfs_v0.12.2_linux-amd64.tar.gz.sha512)" ]
then
echo "ipfs failed checksum check"
exit 1
fi
tar -xf go-ipfs_v0.12.2_linux-amd64.tar.gz
mv go-ipfs/ipfs /usr/local/bin/ipfs
chmod +x /usr/local/bin/ipfs
install_ipfs_macos:
steps:
- run: |
curl -O https://dist.ipfs.io/kubo/v0.14.0/kubo_v0.14.0_darwin-amd64.tar.gz
tar -xvzf kubo_v0.14.0_darwin-amd64.tar.gz
pushd kubo pushd kubo
sudo bash install.sh sudo bash install.sh
popd popd
rm -rf kubo/ rm -rf kubo
rm kubo_v0.14.0_darwin-amd64.tar.gz
git_fetch_all_tags: git_fetch_all_tags:
steps: steps:
- run: - run:
@ -339,7 +323,6 @@ jobs:
- prepare: - prepare:
linux: false linux: false
darwin: true darwin: true
- install_ipfs_macos
- restore_cache: - restore_cache:
name: restore cargo cache name: restore cargo cache
key: v3-go-deps-{{ arch }}-{{ checksum "~/go/src/github.com/filecoin-project/lotus/go.sum" }} key: v3-go-deps-{{ arch }}-{{ checksum "~/go/src/github.com/filecoin-project/lotus/go.sum" }}
@ -368,7 +351,6 @@ jobs:
- prepare: - prepare:
linux: false linux: false
darwin: true darwin: true
- install_ipfs_macos
- restore_cache: - restore_cache:
name: restore cargo cache name: restore cargo cache
key: v3-go-deps-{{ arch }}-{{ checksum "~/go/src/github.com/filecoin-project/lotus/go.sum" }} key: v3-go-deps-{{ arch }}-{{ checksum "~/go/src/github.com/filecoin-project/lotus/go.sum" }}
@ -394,7 +376,7 @@ jobs:
when: always when: always
- run: - run:
name: cleanup homebrew name: cleanup homebrew
command: HOMEBREW_NO_AUTO_UPDATE=1 brew uninstall pkg-config goreleaser/tap/goreleaser-pro coreutils jq hwloc command: HOMEBREW_NO_AUTO_UPDATE=1 brew uninstall pkg-config coreutils jq hwloc
when: always when: always
release: release:
@ -405,6 +387,12 @@ jobs:
description: should this release actually publish it's artifacts? description: should this release actually publish it's artifacts?
type: boolean type: boolean
steps: steps:
- checkout
- run: |
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list
sudo apt update
sudo apt install goreleaser-pro
- install_ipfs
- attach_workspace: - attach_workspace:
at: /tmp/workspace at: /tmp/workspace
- when: - when:

View File

@ -1,8 +1,4 @@
project_name: lotus project_name: lotus
before:
hooks:
- go mod tidy
- make deps
universal_binaries: universal_binaries:
- id: lotus - id: lotus