From c70efab25c3c6a4732e92424595b6278af20fc6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20P=C5=82aczek?= Date: Sun, 8 Sep 2024 00:58:54 +0100 Subject: [PATCH] feat: gh action --- .github/workflows/publish.yml | 53 +++++++++++++++++++++++++++++++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..f4104e0 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,53 @@ +name: 'publish' + +on: + push: + branches: + - main + workflow_dispatch: + +concurrency: production + +permissions: + contents: write + +jobs: + publish: + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4.1.7 + + - name: Restore Apt packages + uses: awalsh128/cache-apt-pkgs-action@v1.4.2 + with: + packages: libclang1 gcc-arm-linux-gnueabihf + version: "1.0" + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@1.81.0 + with: + targets: armv7-unknown-linux-gnueabihf + + - name: Restore Rust cache + uses: Swatinem/rust-cache@v2.7.3 + + - name: Build + run: cargo build --release --target=armv7-unknown-linux-gnueabihf + + - name: Rename binary + run: cp target/armv7-unknown-linux-gnueabihf/release/rspi-bios ./rspi-bios-armv7-unknown-linux-gnu + + - name: Tag + id: tag + uses: anothrNick/github-tag-action@1.70.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + INITIAL_VERSION: "1.0.0" + + - name: Release + uses: softprops/action-gh-release@v2.0.8 + with: + tag_name: ${{ steps.tag.outputs.new_tag }} + files: "rspi-bios-armv7-unknown-linux-gnu" + fail_on_unmatched_files: true diff --git a/Cargo.lock b/Cargo.lock index 694b908..c535147 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -915,7 +915,7 @@ dependencies = [ [[package]] name = "rspi-bios" -version = "0.1.0" +version = "1.0.0" dependencies = [ "anyhow", "askama", diff --git a/Cargo.toml b/Cargo.toml index c8df677..68e872b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "rspi-bios" authors = ["Piotr Placzek "] -version = "0.1.0" +version = "1.0.0" edition = "2021" repository = "https://github.com/piotrpdev/rspi-bios" license = "GPL-3.0"