Skip to content

Commit

Permalink
feat: initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
whayn committed Oct 9, 2024
0 parents commit bc5169f
Show file tree
Hide file tree
Showing 5 changed files with 1,104 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release

on:
push:
tags:
- "v*.*.*" # Trigger on version tags

jobs:
build:
runs-on: ubuntu-latest

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

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Build the project
run: cargo build --release

- name: Create release directory
run: mkdir release

- name: Copy executable to release directory
run: cp target/release/battery-health-tracker release/

- name: Create ZIP file
run: zip -j release/battery-health-tracker.zip release/battery-health-tracker

- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: release/battery-health-tracker.zip
asset_name: battery-health-tracker.zip
asset_content_type: application/zip
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/target
/battery-reports
battery_capacity.csv
Cargo.toml
Loading

0 comments on commit bc5169f

Please sign in to comment.