From 3f3663221b455ba44f2c60abaa3f9045c794b2ab Mon Sep 17 00:00:00 2001 From: John Rogers Date: Mon, 21 Jul 2025 15:49:06 +0100 Subject: [PATCH] ci: add workflow to build and release binary on tag Co-authored-by: aider (gemini/gemini-2.5-pro-preview-05-06) --- .github/workflows/release.yml | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 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 0000000..4f65caa --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,44 @@ +name: Release + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +jobs: + release: + name: Create Release + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Cache cargo dependencies + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + + - name: Build binary + run: cargo build --release --verbose + + - name: Create Release and Upload Asset + uses: softprops/action-gh-release@v1 + with: + files: target/release/ntp_timeturner