feat: add daemon option #11
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Rust CI & Release | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: [ "master" ] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build: | |
| name: Build - ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ windows-latest ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Build | |
| run: cargo build --release | |
| - name: Archive production artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Capsense-${{ matrix.os }} | |
| path: target/release/Capsense.exe | |
| release: | |
| name: Release | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: Capsense-windows-latest | |
| path: artifacts/ | |
| - name: Get Release Notes | |
| id: release_notes | |
| shell: bash | |
| run: | | |
| # Get current tag commit message | |
| TAG_NAME=${GITHUB_REF#refs/tags/} | |
| COMMIT_MSG=$(git log -1 --format=%B) | |
| # Get previous tag | |
| PREV_TAG=$(git describe --tags --abbrev=0 ${TAG_NAME}^ 2>/dev/null || echo "") | |
| if [ -z "$PREV_TAG" ]; then | |
| CHANGELOG_LINK="[See all commits](https://github.com/${{ github.repository }}/commits/${TAG_NAME})" | |
| else | |
| CHANGELOG_LINK="[See commits since $PREV_TAG](https://github.com/${{ github.repository }}/compare/${PREV_TAG}...${TAG_NAME})" | |
| fi | |
| echo "BODY<<EOF" >> $GITHUB_ENV | |
| echo "$COMMIT_MSG" >> $GITHUB_ENV | |
| echo "" >> $GITHUB_ENV | |
| echo "$CHANGELOG_LINK" >> $GITHUB_ENV | |
| echo "EOF" >> $GITHUB_ENV | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| body: ${{ env.BODY }} | |
| files: artifacts/Capsense.exe | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |