From 0f840f0793f664bd0686e2a96644a61da992915e Mon Sep 17 00:00:00 2001 From: Michael Rogenmoser Date: Wed, 27 Dec 2023 19:30:37 +0100 Subject: [PATCH 1/2] Create release for universal macos --- .github/workflows/release.yaml | 42 ++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 425d7d34..97663cfa 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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 From f3645fa5ecc9855dd28970f23297d8ba6c08ff23 Mon Sep 17 00:00:00 2001 From: Michael Rogenmoser Date: Wed, 27 Dec 2023 19:49:17 +0100 Subject: [PATCH 2/2] Fix rhel9 docker container names --- .github/scripts/gen_dockerfile.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/scripts/gen_dockerfile.sh b/.github/scripts/gen_dockerfile.sh index e215a00b..a6dd34af 100755 --- a/.github/scripts/gen_dockerfile.sh +++ b/.github/scripts/gen_dockerfile.sh @@ -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