Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernauer committed Aug 17, 2023
1 parent 1b90285 commit 06b318c
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 5 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,6 @@ jobs:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
# Currently Widnows build fails with
# cargo:warning=# runtime/cgo
# cargo:warning=cgo: C compiler "C:\\Program" not found: exec: "C:\\Program": file does not exist
# error occurred: Command "go" "build" "-buildmode" "c-archive" "-o" "D:\\a\\stackable-cockpit\\stackable-cockpit\\target\\debug\\build\\helm-sys-cce901864d7b6e8c\\out\\libgo-helm-wrapper.a" "go-helm-wrapper/main.go" with args "go-helm-wrapper" did not execute successfully (status code exit code: 1).
# so that Windows build is disabled for now
- target: x86_64-pc-windows-gnu
os: windows-latest
- target: x86_64-apple-darwin
Expand Down Expand Up @@ -394,6 +389,7 @@ jobs:
if: matrix.os == 'windows-latest'
run: cargo build --target ${{ matrix.target }} -p stackablectl
shell: msys2 {0}
# End of OS differences

# Commented out, as this was always failing.
# We can comment it in again once want our image to be certified
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/release_stackablectl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
name: Stackablectl Release Pipeline

on:
push:
tags:
- "stackablectl-[0-9]+.[0-9]+.[0-9]+"

jobs:
release:
name: Release for ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-20.04 # We don't use ubuntu-latest because we want to build against an old glibc version. (18.04 has glibc 2.27, 20.04 has glibc 2.31, 22.04 has glibc 2.35)
file-suffix: ""
- target: x86_64-pc-windows-gnu
os: windows-latest
file-suffix: ".exe"
- target: x86_64-apple-darwin
os: macos-latest
file-suffix: ""
- target: aarch64-apple-darwin
os: macos-latest
file-suffix: ""
steps:
- name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e # v1
with:
toolchain: ${{ env.RUST_VERSION }}
targets: ${{ matrix.target }}
# Normal OS
- name: Build for non-Windows
if: matrix.os != 'windows-latest'
run: cargo build --target ${{ matrix.target }} --release -p stackablectl
# Windows
- name: Prepare Windows env
if: matrix.os == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: base-devel mingw-w64-x86_64-go mingw-w64-x86_64-rust
- name: Build for Windows
if: matrix.os == 'windows-latest'
run: cargo build --target ${{ matrix.target }} --release -p stackablectl
shell: msys2 {0}
# End of OS differences
- name: Rename binary file
run: mv target/${{ matrix.target }}/release/stackablectl${{ matrix.file-suffix }} stackablectl-${{ matrix.target }}${{ matrix.file-suffix }}
- name: Upload Release binaries
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
with:
files: stackablectl-${{ matrix.target }}${{ matrix.file-suffix }}

0 comments on commit 06b318c

Please sign in to comment.