Skip to content

Commit

Permalink
Merge pull request #145 from pulp-platform/macos
Browse files Browse the repository at this point in the history
Add macos release build
  • Loading branch information
micprog authored Jan 8, 2024
2 parents 623539e + f3645fa commit 83fa382
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .github/scripts/gen_dockerfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ if [ $(echo $full_tgtname | cut -d ':' -f 1) = "rhel" ]; then
export maj_version=$(echo $full_tgtname | cut -d ':' -f 2)
export full_tgtname=redhat/ubi${maj_version:0:1}:$(echo $full_tgtname | cut -d ':' -f 2)
if [ $(echo $full_tgtname | cut -d ':' -f 2 | cut -d '.' -f 1) = '9' ]; then
export full_tgtname=$full_tgtname.0
if [ $(echo $full_tgtname | cut -d ':' -f 2 | cut -d '.' -f 2) = '0' ]; then
export full_tgtname=$full_tgtname.0
fi
if [ $(echo $full_tgtname | cut -d ':' -f 2 | cut -d '.' -f 2) = '1' ]; then
export full_tgtname=$full_tgtname.0
fi
fi
fi

Expand Down
42 changes: 40 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,43 @@ jobs:
asset_path: ${{ env.ARTIFACT_PATHNAME }}
asset_name: ${{ env.ARTIFACT_NAME }}
asset_content_type: application/tar.gz


release-macos:
runs-on: macos-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
- name: universal2 install
run: |
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin
cargo install universal2
- name: MacOS Build
run: cargo universal2 --release
- name: Get Artifact Name
run: |
if [[ "$GITHUB_REF" =~ ^refs/tags/v.*$ ]]; then \
PKG_VERSION=$(echo $GITHUB_REF | sed -n 's/^refs\/tags\/v//p'); \
else \
PKG_VERSION=$(echo $GITHUB_REF | sed -n 's/^refs\/tags\///p'); \
fi
ARTIFACT_PATHNAME="bender-$PKG_VERSION-universal-apple-darwin.tar.gz"
ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME)
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
echo "ARTIFACT_PATHNAME=${ARTIFACT_PATHNAME}" >> $GITHUB_ENV
- name: Create Package
run: |
gtar -czf $ARTIFACT_PATHNAME -C "./target/universal2-apple-darwin/release" --owner=0 --group=0 bender
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.ARTIFACT_PATHNAME }}
asset_name: ${{ env.ARTIFACT_NAME }}
asset_content_type: application/tar.gz

0 comments on commit 83fa382

Please sign in to comment.