Skip to content

Commit

Permalink
Merge pull request #97 from arkedge/add-release-workflow
Browse files Browse the repository at this point in the history
Add release automation workflow for binary distribution
  • Loading branch information
KOBA789 authored Mar 12, 2024
2 parents 4e2faeb + f5468f9 commit 0751a7d
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 8 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Release

on:
push:
branches:
- main
tags: ['v*']

jobs:
build:
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
target:
- x86_64-unknown-linux-musl

steps:
- uses: actions/checkout@v4.1.1

- name: install apt depenedencies
run: |
sudo apt-get update
sudo apt-get install -y musl-tools
- name: Get Rust toolchain
id: toolchain
working-directory: .
run: |
awk -F'[ ="]+' '$1 == "channel" { print "toolchain=" $2 }' rust-toolchain >> "$GITHUB_OUTPUT"
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ steps.toolchain.outputs.toolchain }}
targets: ${{ matrix.target }}

- uses: Swatinem/rust-cache@v2.7.3

- name: install cargo-about
run: |
cargo install --locked cargo-about
- name: Build
run: |
cargo build --target=${{ matrix.target }} --release --locked
- name: Rename binaries
run: |
mkdir bin
gaia_bins=("tmtc-c2a")
for b in "${gaia_bins[@]}" ; do
cp "./target/${{ matrix.target }}/release/${b}" "./bin/${b}-${{ matrix.target }}"
done
ls -lh ./bin
- uses: actions/upload-artifact@v4.3.1
with:
name: release-executable-${{ matrix.target }}
if-no-files-found: error
path: ./bin/

release:
name: Release
needs: [ build ]
permissions:
contents: write

runs-on: ubuntu-22.04

steps:
- uses: actions/download-artifact@v4.1.3
with:
pattern: release-executable-*
merge-multiple: true

- run: |
chmod +x tmtc-c2a
- run: ls -lh

- name: Release to GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v0.1.15
with:
draft: true
fail_on_unmatched_files: true
generate_release_notes: true
files: |
tmtc-c2a
12 changes: 6 additions & 6 deletions 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ exclude = [
]

[workspace.package]
version = "0.6.1"
version = "0.7.0-beta.1"

[workspace.dependencies]
structpack = "0.6"
Expand Down
2 changes: 1 addition & 1 deletion devtools-frontend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "c2a-devtools-frontend"
edition = "2021"
version = "0.6.1"
version = "0.7.0-beta.1"
license = "MPL-2.0"

[dependencies]
Expand Down

0 comments on commit 0751a7d

Please sign in to comment.