-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
_ci_: update snapcraft and release flow logic #8994
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,7 +115,7 @@ jobs: | |
command: | | ||
git --no-pager diff go.mod go.sum | ||
git --no-pager diff --quiet go.mod go.sum | ||
build-all: | ||
build-linux: | ||
executor: golang | ||
steps: | ||
- install-deps | ||
|
@@ -518,6 +518,19 @@ jobs: | |
publish: | ||
description: publish binary artifacts | ||
executor: ubuntu | ||
parameters: | ||
linux: | ||
default: false | ||
description: publish linux binaries? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the question mark? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can make the comment clearer, but the parameter is to indicate whether the linux binaries should be published or not. I usually use ? to indicate true/false things. |
||
type: boolean | ||
darwin: | ||
default: false | ||
description: publish darwin binaries? | ||
type: boolean | ||
appimage: | ||
default: false | ||
description: publish appimage binaries? | ||
type: boolean | ||
steps: | ||
- run: | ||
name: Install git jq curl | ||
|
@@ -528,12 +541,21 @@ jobs: | |
- install_ipfs | ||
- attach_workspace: | ||
at: "." | ||
- run: | ||
name: Create bundles | ||
command: ./scripts/build-bundle.sh | ||
- run: | ||
name: Publish release | ||
command: ./scripts/publish-release.sh | ||
- when: | ||
condition: << parameters.linux >> | ||
steps: | ||
- run: ./scripts/build-arch-bundle.sh linux | ||
- run: ./scripts/publish-arch-release.sh linux | ||
- when: | ||
condition: << parameters.darwin>> | ||
steps: | ||
- run: ./scripts/build-arch-bundle.sh darwin | ||
- run: ./scripts/publish-arch-release.sh darwin | ||
- when: | ||
condition: << parameters.appimage >> | ||
steps: | ||
- run: ./scripts/build-appimage-bundle.sh | ||
- run: ./scripts/publish-arch-release.sh appimage | ||
|
||
publish-snapcraft: | ||
description: build and push snapcraft | ||
|
@@ -550,11 +572,6 @@ jobs: | |
- run: | ||
name: install snapcraft | ||
command: sudo snap install snapcraft --classic | ||
- run: | ||
name: create snapcraft config file | ||
command: | | ||
mkdir -p ~/.config/snapcraft | ||
echo "$SNAPCRAFT_LOGIN_FILE" | base64 -d > ~/.config/snapcraft/snapcraft.cfg | ||
- run: | ||
name: build snap | ||
command: snapcraft --use-lxd | ||
|
@@ -1020,7 +1037,7 @@ workflows: | |
only: | ||
- master | ||
- build-debug | ||
- build-all: | ||
- build-linux: | ||
filters: | ||
tags: | ||
only: | ||
|
@@ -1042,6 +1059,18 @@ workflows: | |
only: | ||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/ | ||
- build-appimage: | ||
filters: | ||
branches: | ||
only: | ||
- /^release\/v\d+\.\d+\.\d+(-rc\d+)?$/ | ||
tags: | ||
only: | ||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/ | ||
- publish: | ||
name: publish-macos | ||
darwin: true | ||
requires: | ||
- build-macos | ||
filters: | ||
branches: | ||
ignore: | ||
|
@@ -1050,9 +1079,21 @@ workflows: | |
only: | ||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/ | ||
- publish: | ||
name: publish-linux | ||
linux: true | ||
requires: | ||
- build-linux | ||
filters: | ||
branches: | ||
ignore: | ||
- /.*/ | ||
tags: | ||
only: | ||
- /^v\d+\.\d+\.\d+(-rc\d+)?$/ | ||
- publish: | ||
name: publish-appimage | ||
appimage: true | ||
requires: | ||
- build-all | ||
- build-macos | ||
- build-appimage | ||
filters: | ||
branches: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
REQUIRED=( | ||
"ipfs" | ||
"sha512sum" | ||
) | ||
for REQUIRE in "${REQUIRED[@]}" | ||
do | ||
command -v "${REQUIRE}" >/dev/null 2>&1 || echo >&2 "'${REQUIRE}' must be installed" | ||
done | ||
|
||
mkdir bundle | ||
pushd bundle | ||
|
||
export IPFS_PATH=`mktemp -d` | ||
ipfs init | ||
ipfs daemon & | ||
PID="$!" | ||
trap "kill -9 ${PID}" EXIT | ||
sleep 30 | ||
|
||
cp "../appimage/Lotus-${CIRCLE_TAG}-x86_64.AppImage" . | ||
sha512sum "Lotus-${CIRCLE_TAG}-x86_64.AppImage" > "Lotus-${CIRCLE_TAG}-x86_64.AppImage.sha512" | ||
ipfs add -q "Lotus-${CIRCLE_TAG}-x86_64.AppImage" > "Lotus-${CIRCLE_TAG}-x86_64.AppImage.cid" | ||
popd |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
ARCH=$1 | ||
|
||
REQUIRED=( | ||
"ipfs" | ||
"sha512sum" | ||
) | ||
for REQUIRE in "${REQUIRED[@]}" | ||
do | ||
command -v "${REQUIRE}" >/dev/null 2>&1 || echo >&2 "'${REQUIRE}' must be installed" | ||
done | ||
|
||
mkdir bundle | ||
pushd bundle | ||
|
||
BINARIES=( | ||
"lotus" | ||
"lotus-miner" | ||
"lotus-worker" | ||
) | ||
|
||
export IPFS_PATH=`mktemp -d` | ||
ipfs init | ||
ipfs daemon & | ||
PID="$!" | ||
trap "kill -9 ${PID}" EXIT | ||
sleep 30 | ||
|
||
mkdir -p "${ARCH}/lotus" | ||
pushd "${ARCH}" | ||
for BINARY in "${BINARIES[@]}" | ||
do | ||
cp "../../${ARCH}/${BINARY}" "lotus/" | ||
chmod +x "lotus/${BINARY}" | ||
done | ||
|
||
tar -zcvf "../lotus_${CIRCLE_TAG}_${ARCH}-amd64.tar.gz" lotus | ||
popd | ||
rm -rf "${ARCH}" | ||
|
||
sha512sum "lotus_${CIRCLE_TAG}_${ARCH}-amd64.tar.gz" > "lotus_${CIRCLE_TAG}_${ARCH}-amd64.tar.gz.sha512" | ||
|
||
ipfs add -q "lotus_${CIRCLE_TAG}_${ARCH}-amd64.tar.gz" > "lotus_${CIRCLE_TAG}_${ARCH}-amd64.tar.gz.cid" | ||
popd |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It only builds linux binaries, there are separate build tasks for other target platforms. I think the all was supposed to mean it's building all lotus commands, but I found it very confusing.
build-linux
matches pattern used elsewhere better (i.e.build-macos
)