Skip to content
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

chore: use explicit os versions #634

Merged
merged 2 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions .github/workflows/publish-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,26 @@ jobs:
# For these target platforms
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
os: ubuntu-24.04
arch: x86_64
ext: deb
protoc-arch: linux-x86_64
- target: x86_64-unknown-linux-gnu
os: ubuntu-22.04
arch: x86_64
ext: deb
protoc-arch: linux-x86_64
- target: x86_64-apple-darwin
os: macos-latest
os: macos-14
arch: x86_64
ext: bin
protoc-arch: osx-x86_64
- target: aarch64-apple-darwin
os: macos-latest
os: macos-14
config-file: fpm/osx.fpm
arch: aarch64
ext: bin
protoc-arch: osx-aarch_64
#- target: x86_64-pc-windows-msvc
# os: windows-latest
runs-on: ${{ matrix.os }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -69,18 +72,18 @@ jobs:
gem install fpm
- name: Run package script
run: |
./ci-scripts/package.sh -a ${{ matrix.arch }} -e ${{ matrix.ext }}
./ci-scripts/package.sh -a ${{ matrix.arch }} -e ${{ matrix.ext }} -v ${{ matrix.os }}
- name: Archive Binary
uses: actions/upload-artifact@v3
with:
name: ceramic-one_${{ matrix.target }}
path: ceramic-one_${{ matrix.target }}.bin.tar.gz
name: ceramic-one_${{ matrix.target }}-${{ matrix.os }}
path: ceramic-one_${{ matrix.target }}-${{ matrix.os }}.bin.tar.gz
- name: Archive Debian Package
uses: actions/upload-artifact@v3
if: ${{ matrix.ext == 'deb' }}
with:
name: ceramic-one_${{ matrix.target }}
path: ceramic-one_${{ matrix.target }}.tar.gz
name: ceramic-one_${{ matrix.target }}-${{ matrix.os }}
path: ceramic-one_${{ matrix.target }}-${{ matrix.os }}.tar.gz
Comment on lines +79 to +86
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll also need to use the new OS suffix in ci-scripts/package.sh when preparing the archive, and in .github/workflows/update-homebrew.yml when retrieving the archive SHA.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, wait, let me check that again.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think we'll need to update the other two files since the specific OS version is now also part of the archive name.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As well as this js-ceramic file.


release:
needs: [build-binaries]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-homebrew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
echo "VERSION=$(jq -r '.tagName' release.json)" >> $GITHUB_OUTPUT
echo "X86_URL=$(jq -r '.assets[] | select(.name | contains("x86_64-apple-darwin")) | .url' release.json)" >> $GITHUB_OUTPUT
echo "ARM_URL=$(jq -r '.assets[] | select(.name | contains("aarch64-apple-darwin")) | .url' release.json)" >> $GITHUB_OUTPUT
echo "X86_SHA=$(sha256sum ceramic-one_x86_64-apple-darwin.bin.tar.gz | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT
echo "ARM_SHA=$(sha256sum ceramic-one_aarch64-apple-darwin.bin.tar.gz | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT
echo "X86_SHA=$(sha256sum ceramic-one_x86_64-apple-darwin-macos-*.bin.tar.gz | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT
echo "ARM_SHA=$(sha256sum ceramic-one_aarch64-apple-darwin-macos-*.bin.tar.gz | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT
- name: Checkout Homebrew Tap
uses: actions/checkout@v4
with:
Expand Down
11 changes: 8 additions & 3 deletions ci-scripts/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ INSTALL_DIR="/usr/local/bin"

OS="unknown-linux-gnu"
ARCH=""
OS_VERSION=""
case $(uname -m) in
x86_64) ARCH="x86_64" ;;
arm64) ARCH="aarch64" ;;
Expand All @@ -29,7 +30,7 @@ fi

echo "Evaluating program arguments '$@'"

while getopts "f:e:d:i:a:" opt
while getopts "f:e:d:i:a:v" opt
do
case "$opt" in
f)
Expand All @@ -52,6 +53,10 @@ do
echo "Setting architecture to "$OPTARG
ARCH=$OPTARG
;;
v)
echo "Setting os version to "$OPTARG
OS_VERSION="-${OPTARG}"
;;
\? )
echo "Invalid option: -$OPTARG" 1>&2
exit 1
Expand Down Expand Up @@ -83,12 +88,12 @@ echo "Building artifacts for "$TARGET
cargo build --release --locked --target $TARGET

echo "Compressing binary package for $TARGET"
tar -cvzf ceramic-one_$TARGET.bin.tar.gz -C $BIN_DIR ceramic-one
tar -cvzf ceramic-one_${TARGET}${OS_VERSION}.bin.tar.gz -C $BIN_DIR ceramic-one

if [ "$EXT" != "bin" ]; then
echo "Building package for $TARGET"
fpm --fpm-options-file $CONFIG_FILE -C $BIN_DIR -v $PKG_VERSION -p $OUT_PATH ceramic-one=$INSTALL_DIR/ceramic-one

echo "Compressing package for $TARGET"
tar -cvzf ceramic-one_$TARGET.tar.gz -C $ARTIFACTS_DIR $OUT_FILE
tar -cvzf ceramic-one_${TARGET}${OS_VERSION}.tar.gz -C $ARTIFACTS_DIR $OUT_FILE
fi
Loading