Skip to content

Commit

Permalink
Built Macos binary for ARM, deleted AMD build (#452)
Browse files Browse the repository at this point in the history
* Update CI runner to macos-14

* Updated actions/upload-artifact to v4

* Bump v3.0.2.rc2

* Fix ssl error in macos

* Use xcode-select

* brew install openssl

* Restore brew install libpq

* Add flags

* Fix release.yaml

* Upd actions/download-artifact

* Del brew install openssl

* Check python version and openssl version

* More openssl logging

* Fix logging

* Fix 2

* Fix 3

* Move changes to release.yaml

* Fix

* Install [email protected]

* Update actions/setup-python to v5

* Cleanup

* Bump v3.0.2

* Cleanup 2
  • Loading branch information
evgeny-stakewise authored Feb 3, 2025
1 parent dc2d8ff commit bcd4265
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.12.8

Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.12.8

Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.12.8

Expand Down
24 changes: 15 additions & 9 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.12.8

Expand Down Expand Up @@ -67,11 +67,11 @@ jobs:
cp ${BUILD_FILE_NAME}.tar.gz /tmp/artifacts;
sha256sum ${BUILD_FILE_NAME}.tar.gz | head -c 64 > /tmp/artifacts/${BUILD_FILE_NAME}.sha256;
- OS: macos-13
- OS: macos-14
PYTHON_VERSION: 3.12.8
BUILD_CMD: |
export PYTHONHASHSEED=42
export BUILD_FILE_NAME=operator-${RELEASE_VERSION}-darwin-amd64;
export BUILD_FILE_NAME=operator-${RELEASE_VERSION}-darwin-arm64;
mkdir ${BUILD_FILE_NAME};
git rev-parse --short HEAD > GIT_SHA
poetry run pyinstaller \
Expand Down Expand Up @@ -112,9 +112,10 @@ jobs:
run: |
brew install libpq
brew link --force libpq
if: matrix.os == 'macos-13'
brew install [email protected]
if: matrix.os == 'macos-14'

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.PYTHON_VERSION }}

Expand All @@ -125,6 +126,11 @@ jobs:

- name: Install dependencies
run: poetry install --with build --without dev --no-interaction --no-root
env:
# For building psycopg on MacOS
# Required the the same version of openssl as the one used by the Python installation
LDFLAGS: "-L/opt/homebrew/opt/[email protected]/lib"
CPPFLAGS: "-I/opt/homebrew/opt/[email protected]/include"

- name: Get the version
id: get_version
Expand All @@ -136,7 +142,7 @@ jobs:
run: ${{ matrix.BUILD_CMD }}

- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.OS }}
path: /tmp/artifacts/*
Expand All @@ -147,7 +153,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: /tmp/artifacts

Expand All @@ -168,7 +174,7 @@ jobs:
/tmp/artifacts/ubuntu-20.04/operator-${{ steps.get_version.outputs.VERSION }}-linux-amd64.sha256
/tmp/artifacts/linux-arm-runner/operator-${{ steps.get_version.outputs.VERSION }}-linux-arm64.tar.gz
/tmp/artifacts/linux-arm-runner/operator-${{ steps.get_version.outputs.VERSION }}-linux-arm64.sha256
/tmp/artifacts/macos-13/operator-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.tar.gz
/tmp/artifacts/macos-13/operator-${{ steps.get_version.outputs.VERSION }}-darwin-amd64.sha256
/tmp/artifacts/macos-14/operator-${{ steps.get_version.outputs.VERSION }}-darwin-arm64.tar.gz
/tmp/artifacts/macos-14/operator-${{ steps.get_version.outputs.VERSION }}-darwin-arm64.sha256
/tmp/artifacts/windows-latest/operator-${{ steps.get_version.outputs.VERSION }}-windows-amd64.zip
/tmp/artifacts/windows-latest/operator-${{ steps.get_version.outputs.VERSION }}-windows-amd64.sha256
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,14 @@ Head to [Usage](#usage) to launch your operator service.
Pull the latest docker operator docker image:

```bash
docker pull europe-west4-docker.pkg.dev/stakewiselabs/public/v3-operator:v3.0.1
docker pull europe-west4-docker.pkg.dev/stakewiselabs/public/v3-operator:v3.0.2
```

You can also build the docker image from source by cloning this repo and executing the following command from within
the `v3-operator` folder:

```bash
docker build --pull -t europe-west4-docker.pkg.dev/stakewiselabs/public/v3-operator:v3.0.1 .
docker build --pull -t europe-west4-docker.pkg.dev/stakewiselabs/public/v3-operator:v3.0.2 .
```

You will execute Operator Service commands using the format below (note the use of flags are optional):
Expand All @@ -170,7 +170,7 @@ You will execute Operator Service commands using the format below (note the use
docker run --rm -ti \
-u $(id -u):$(id -g) \
-v ~/.stakewise/:/data \
europe-west4-docker.pkg.dev/stakewiselabs/public/v3-operator:v3.0.1 \
europe-west4-docker.pkg.dev/stakewiselabs/public/v3-operator:v3.0.2 \
src/main.py COMMAND \
--flagA=123 \
--flagB=xyz
Expand Down Expand Up @@ -393,7 +393,7 @@ below:
docker run --restart on-failure:10 \
-u $(id -u):$(id -g) \
-v ~/.stakewise/:/data \
europe-west4-docker.pkg.dev/stakewiselabs/public/v3-operator:v3.0.1 \
europe-west4-docker.pkg.dev/stakewiselabs/public/v3-operator:v3.0.2 \
src/main.py start \
--vault=0x3320ad928c20187602a2b2c04eeaa813fa899468 \
--data-dir=/data \
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "v3-operator"
version = "v3.0.1"
version = "v3.0.2"
description = "StakeWise operator service for registering vault validators"
authors = ["StakeWise Labs <[email protected]>"]
package-mode = false
Expand Down
2 changes: 1 addition & 1 deletion scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ http_copy() {
github_release() {
owner_repo=$1
version=$2
test -z "$version" && version="v3.0.1"
test -z "$version" && version="v3.0.2"
giturl="https://github.com/${owner_repo}/releases/${version}"
json=$(http_copy "$giturl" "Accept:application/json")
test -z "$json" && return 1
Expand Down

0 comments on commit bcd4265

Please sign in to comment.