Skip to content

Commit

Permalink
Drop using artifacts upload and download for release workflow (#1183)
Browse files Browse the repository at this point in the history
Move building x86_64 and aarch64 directly to create_github_release
step in order to fix GitHub release creation. Bump server version
to test new release flow.
  • Loading branch information
BartoszCiesla authored Aug 25, 2024
1 parent 4946804 commit 7058be5
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 14 deletions.
62 changes: 50 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,6 @@ jobs:
cp target/${{ matrix.platform.target }}/release/iggy-server release_artifacts/
cp target/${{ matrix.platform.target }}/release/iggy release_artifacts/
- name: Upload release assets to GitHub Actions
uses: actions/upload-artifact@v4
with:
name: iggy-${{ matrix.platform.os_name }}
path: release_artifacts/

- name: Print message
run: echo "::notice ::Published ${{ needs.tag.outputs.server_version }} release artifacts on GitHub"

Expand Down Expand Up @@ -244,18 +238,62 @@ jobs:
runs-on: ubuntu-latest
if: ${{ needs.tag.outputs.tag_created == 'true' }}
needs:
- release_and_publish
- tag
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download all artifacts
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
- name: Cache cargo & target directories
uses: Swatinem/rust-cache@v2
with:
pattern: 'iggy-*'
path: all_artifacts
merge-multiple: true
key: "v2"

- name: Install musl-tools on Linux
run: sudo apt-get update --yes && sudo apt-get install --yes musl-tools

- name: Build iggy-server release binary for Linux-x86_64
uses: houseabsolute/actions-rust-cross@v0
with:
command: "build"
target: x86_64-unknown-linux-musl
toolchain: stable
args: "--verbose --release --bin iggy-server"

- name: Build iggy-cli release binary for Linux-x86_64
uses: houseabsolute/actions-rust-cross@v0
with:
command: "build"
target: x86_64-unknown-linux-musl
toolchain: stable
args: "--verbose --release --no-default-features --bin iggy"

- name: Prepare Linux-x86_64 artifacts
run: |
mkdir -p all_artifacts/Linux-x86_64
cp target/x86_64-unknown-linux-musl/release/iggy-server all_artifacts/Linux-x86_64/
cp target/x86_64-unknown-linux-musl/release/iggy all_artifacts/Linux-x86_64/
- name: Build iggy-server release binary for Linux-aarch64
uses: houseabsolute/actions-rust-cross@v0
with:
command: "build"
target: aarch64-unknown-linux-musl
toolchain: stable
args: "--verbose --release --bin iggy-server"

- name: Build iggy-cli release binary for Linux-aarch64
uses: houseabsolute/actions-rust-cross@v0
with:
command: "build"
target: aarch64-unknown-linux-musl
toolchain: stable
args: "--verbose --release --no-default-features --bin iggy"

- name: Prepare Linux-aarch64 artifacts
run: |
mkdir -p all_artifacts/Linux-aarch64
cp target/aarch64-unknown-linux-musl/release/iggy-server all_artifacts/Linux-aarch64/
cp target/aarch64-unknown-linux-musl/release/iggy all_artifacts/Linux-aarch64/
- name: Zip artifacts for each platform
run: |
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "server"
version = "0.4.20"
version = "0.4.21"
edition = "2021"
build = "src/build.rs"

Expand Down

0 comments on commit 7058be5

Please sign in to comment.