Skip to content

Commit

Permalink
workflow fix
Browse files Browse the repository at this point in the history
Signed-off-by: Emre YILMAZ <[email protected]>
  • Loading branch information
delirehberi committed May 27, 2024
1 parent 4988d54 commit 1721246
Showing 1 changed file with 45 additions and 29 deletions.
74 changes: 45 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: Release

on:
workflow_dispatch:
push:
branches:
- master
- dev
tags:
- 'v*.*.*'

Expand All @@ -11,22 +15,28 @@ jobs:

strategy:
matrix:
target: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu]
include:
- os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
code-target: linux-x64
container: ubuntu:18.04
- os: ubuntu-20.04
target: aarch64-unknown-linux-gnu
code-target: linux-arm64
- os: ubuntu-20.04
target: arm-unknown-linux-gnueabihf
code-target: linux-armhf
- os: macos-11
target: x86_64-apple-darwin
code-target: darwin-x64
- os: macos-11
target: aarch64-apple-darwin
code-target: darwin-arm64

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}

- name: Install dependencies for cross-compilation
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu

- name: Build
run: cargo build --release --target ${{ matrix.target }}

Expand All @@ -39,6 +49,25 @@ jobs:
release:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
include:
- os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
code-target: linux-x64
container: ubuntu:18.04
- os: ubuntu-20.04
target: aarch64-unknown-linux-gnu
code-target: linux-arm64
- os: ubuntu-20.04
target: arm-unknown-linux-gnueabihf
code-target: linux-armhf
- os: macos-11
target: x86_64-apple-darwin
code-target: darwin-x64
- os: macos-11
target: aarch64-apple-darwin
code-target: darwin-arm64

steps:
- name: Checkout repository
Expand All @@ -47,12 +76,8 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: tiller-x86_64-unknown-linux-gnu
path: tiller-x86_64-unknown-linux-gnu
- uses: actions/download-artifact@v2
with:
name: tiller-aarch64-unknown-linux-gnu
path: tiller-aarch64-unknown-linux-gnu
name: tiller-${{ matrix.target }}
path: tiller-${{ matrix.target }}

- name: Create release
id: create_release
Expand All @@ -65,23 +90,14 @@ jobs:
draft: false
prerelease: false

- name: Upload x86_64 binary to release
- name: Upload ${{matrix.target}} binary to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: tiller-x86_64-unknown-linux-gnu/tiller
asset_name: tiller-x86_64-unknown-linux-gnu
asset_path: tiller-${{matrix.target}}/tiller
asset_name: tiller-${{matrix.target}}
asset_content_type: application/octet-stream

- name: Upload aarch64 binary to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: tiller-aarch64-unknown-linux-gnu/tiller
asset_name: tiller-aarch64-unknown-linux-gnu
asset_content_type: application/octet-stream

0 comments on commit 1721246

Please sign in to comment.