Skip to content

Commit

Permalink
Prepare for release v0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiojmendes committed Aug 21, 2024
1 parent 7495000 commit cc8489b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 14 deletions.
37 changes: 25 additions & 12 deletions .github/workflows/rust_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,42 @@ env:
CARGO_TERM_COLOR: always

jobs:
rust-checks:
name: Build
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Enable caching
uses: Swatinem/rust-cache@v2

- name: Run fmt command
run: cargo fmt --all -- --check --color always

- name: Run clippy command
run: cargo clippy --all-targets --all-features --workspace -- -D warnings

deploy:
if: github.ref_type == 'tag'
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
chip: ["nrf52840"]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Validate version
if: github.event_name == 'push' && github.ref_type == 'tag'
run: |
export CARGO_VERSION=v$(awk '/^version/ {print $3}' Cargo.toml | head -1 | tr -d '"')
export GIT_VERSION=${{github.ref_name}}
echo "$CARGO_VERSION and $GIT_VERSION"
echo "Cargo version: $CARGO_VERSION"
echo "Git version: $GIT_VERSION"
if [[ "${CARGO_VERSION}" != "$GIT_VERSION" ]]; then
echo "Tag version and Cargo.toml version don't match" 1>&2
exit 1
Expand All @@ -35,22 +55,15 @@ jobs:
- name: Enable caching
uses: Swatinem/rust-cache@v2

- name: Run fmt command
run: cargo fmt --all -- --check --color always

- name: Run clippy command
run: cargo clippy --all-targets --all-features --workspace -- -D warnings

- name: Run build command
env:
DEFMT_LOG: warn
run: cargo build --release

- name: Publish release
uses: ghalactic/github-release-from-tag@v5
if: github.ref_type == 'tag'
with:
generateReleaseNotes: "true"
assets: |
- path: target/thumbv7em-none-eabihf/release/tempsys-firmware
name: tempsys-firmware-${{ github.ref_name }}-nrf52840.elf
name: tempsys-firmware-${{ github.ref_name }}-${{ matrix.chip }}.elf
2 changes: 1 addition & 1 deletion 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
@@ -1,7 +1,7 @@
[package]
edition = "2021"
name = "tempsys-firmware"
version = "0.1.0"
version = "0.1.1"
authors = ["Fabio Mendes <[email protected]>"]
resolver = "2"

Expand Down

0 comments on commit cc8489b

Please sign in to comment.