Skip to content

Commit

Permalink
feat(release): update version (#622)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xfourzerofour authored Mar 4, 2024
1 parent fc82b4d commit 8702543
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 182 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/docker-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
toolchain: 1.71.0
toolchain: 1.75.0

- name: Install toolchain (nightly)
run: rustup toolchain add nightly --component rustfmt --profile minimal
Expand All @@ -40,6 +40,8 @@ jobs:
with:
cache-on-failure: true

- uses: taiki-e/install-action@cross

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
Expand All @@ -53,10 +55,8 @@ jobs:
- name: Build and push image
run: |
cargo install cross --git https://github.com/cross-rs/cross
if [ -n "${{ github.event.inputs.version }}" ]; then
make GIT_TAG="${{ github.event.inputs.version }}" docker-build
sudo -E env "PATH=$PATH" make GIT_TAG="${{ github.event.inputs.version }}" docker-build
else
make docker-build-latest
sudo -E env "PATH=$PATH" make docker-build-latest
fi
87 changes: 40 additions & 47 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,52 +30,52 @@ jobs:

build:
name: build release
runs-on: ${{ matrix.os }}
needs: extract-version
strategy:
matrix:
arch:
[
aarch64-unknown-linux-gnu,
x86_64-unknown-linux-gnu,
x86_64-apple-darwin,
aarch64-apple-darwin,
x86_64-pc-windows-gnu,
]
include:
- arch: aarch64-unknown-linux-gnu
platform: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-20.04
profile: release
- arch: x86_64-unknown-linux-gnu
platform: ubuntu-latest
- target: x86_64-unknown-linux-gnu
os: ubuntu-20.04
profile: release
- arch: x86_64-apple-darwin
platform: macos-latest
- target: x86_64-apple-darwin
os: macos-latest
profile: release
- arch: aarch64-apple-darwin
platform: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
profile: release
- arch: x86_64-pc-windows-gnu
platform: ubuntu-latest
- target: x86_64-pc-windows-gnu
os: ubuntu-20.04
profile: release

runs-on: ${{ matrix.platform }}
needs: extract-version
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Get latest version of stable Rust
run: rustup update stable
- name: Install target
run: rustup target add ${{ matrix.arch }}
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.target }}
- uses: taiki-e/install-action@cross
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- name: Foundry install
if: contains( ${{ matrix.target }}, 'apple')
uses: foundry-rs/foundry-toolchain@v1
- name: Install protobuf
if: contains( ${{ matrix.target }}, 'apple')
uses: arduino/setup-protoc@v3

# ==============================
# Apple Silicon SDK setup
# ==============================

- name: Apple Silicon setup
if: ${{ matrix.job.target == 'aarch64-apple-darwin' }}
if: matrix.target == 'aarch64-apple-darwin'
run: |
echo "SDKROOT=$(xcrun -sdk macosx --show-sdk-path)" >> $GITHUB_ENV
echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version)" >> $GITHUB_ENV
Expand All @@ -84,22 +84,15 @@ jobs:
# Builds
# ==============================

- name: Build rundler for ${{ matrix.arch }}
- name: Build rundler for ${{ matrix.target }}
run: |
cargo install cross
env PROFILE=${{ matrix.profile }} make build-${{ matrix.arch }}
sudo -E env "PATH=$PATH" make build-${{ matrix.target }}
- name: Move cross-compiled binary
if: matrix.arch != 'x86_64-pc-windows-gnu'
run: |
mkdir artifacts
mv target/${{ matrix.arch }}/${{ matrix.profile }}/rundler ./artifacts
- name: Move cross-compiled binary (Windows)
if: matrix.arch == 'x86_64-pc-windows-gnu'
run: |
mkdir artifacts
mv target/${{ matrix.arch }}/${{ matrix.profile }}/rundler.exe ./artifacts
[[ "${{ matrix.target }}" == *windows* ]] && ext=".exe"
sudo mv "target/${{ matrix.target }}/${{ matrix.profile }}/rundler${ext}" ./artifacts
# ==============================
# Signing
Expand All @@ -111,10 +104,10 @@ jobs:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
export GPG_TTY=$(tty)
echo -n "$GPG_SIGNING_KEY" | gpg --batch --import
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --batch --import
cd artifacts
tar -czf rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz rundler*
echo "$GPG_PASSPHRASE" | gpg --passphrase-fd 0 --pinentry-mode loopback --batch -ab rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz
tar -czf rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.target }}.tar.gz rundler*
echo "$GPG_PASSPHRASE" | gpg --passphrase-fd 0 --pinentry-mode loopback --batch -ab rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.target }}.tar.gz
mv *tar.gz* ..
shell: bash

Expand All @@ -125,14 +118,14 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz
path: rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz
name: rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.target }}.tar.gz
path: rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.target }}.tar.gz

- name: Upload signature
uses: actions/upload-artifact@v3
with:
name: rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz.asc
path: rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.arch }}.tar.gz.asc
name: rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.target }}.tar.gz.asc
path: rundler-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.target }}.tar.gz.asc

draft-release:
name: draft release
Expand Down Expand Up @@ -220,7 +213,7 @@ jobs:
)
assets=()
for asset in ./rundler-*.tar.gz*; do
assets+=("-a" "$asset/$asset")
assets+=("$asset/$asset")
done
tag_name="${{ env.VERSION }}"
echo "$body" | gh release create --draft "${assets[@]}" -F "-" "$tag_name"
echo "$body" | gh release create --draft -t "Rundler $tag_name" -F "-" "$tag_name" "${assets[@]}"
Loading

0 comments on commit 8702543

Please sign in to comment.