From 163904405964568d6d06902a80db96f574b6a421 Mon Sep 17 00:00:00 2001 From: sksat Date: Tue, 12 Mar 2024 22:04:18 +0900 Subject: [PATCH 1/2] add release automation workflow for binary distribution --- .github/workflows/release.yml | 89 +++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..bb8e97fd --- /dev/null +++ b/.github/workflows/release.yml @@ -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 From f5468f94ec33bdcd71660d4211c8a9c783485798 Mon Sep 17 00:00:00 2001 From: sksat Date: Tue, 12 Mar 2024 22:32:45 +0900 Subject: [PATCH 2/2] bump version to 0.7.0-beta.1 --- Cargo.lock | 12 ++++++------ Cargo.toml | 2 +- devtools-frontend/Cargo.toml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bafa9813..1d5a949c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -268,7 +268,7 @@ checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "c2a-devtools-frontend" -version = "0.6.1" +version = "0.7.0-beta.1" dependencies = [ "rust-embed", ] @@ -618,7 +618,7 @@ dependencies = [ [[package]] name = "gaia-ccsds-c2a" -version = "0.6.1" +version = "0.7.0-beta.1" dependencies = [ "anyhow", "async-trait", @@ -634,7 +634,7 @@ dependencies = [ [[package]] name = "gaia-stub" -version = "0.6.1" +version = "0.7.0-beta.1" dependencies = [ "prost", "prost-types", @@ -644,7 +644,7 @@ dependencies = [ [[package]] name = "gaia-tmtc" -version = "0.6.1" +version = "0.7.0-beta.1" dependencies = [ "anyhow", "async-trait", @@ -1927,7 +1927,7 @@ dependencies = [ [[package]] name = "structpack" -version = "0.6.1" +version = "0.7.0-beta.1" dependencies = [ "anyhow", "bitvec", @@ -2088,7 +2088,7 @@ dependencies = [ [[package]] name = "tmtc-c2a" -version = "0.6.1" +version = "0.7.0-beta.1" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 04e1a507..888d6812 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ exclude = [ ] [workspace.package] -version = "0.6.1" +version = "0.7.0-beta.1" [workspace.dependencies] structpack = "0.6" diff --git a/devtools-frontend/Cargo.toml b/devtools-frontend/Cargo.toml index 56ca457a..37e2fb14 100644 --- a/devtools-frontend/Cargo.toml +++ b/devtools-frontend/Cargo.toml @@ -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]