update release build #10
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 Build and Test CI 🚀 | |
| on: [push] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| BUILD_TARGET: [release] | |
| outputs: | |
| release_built: ${{ steps.build.outputs.release_built }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build binaries in "${{ matrix.BUILD_TARGET }}" mode | |
| id: build | |
| run: cargo build --profile ${{ matrix.BUILD_TARGET }} | |
| - name: Run tests in "${{ matrix.BUILD_TARGET }}" mode | |
| run: cargo test --profile ${{ matrix.BUILD_TARGET }} | |
| - name: Upload release artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: github-action-test | |
| path: target/${{ matrix.BUILD_TARGET }}/github-action-test | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Ensure full history | |
| - name: Download release artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: github-action-test | |
| path: ./github-action-test | |
| - name: Publish built binary to GitHub releases | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release create v1.0.0 ./github-action-test/github-action-test --title "Release v1.0.0" --notes "Automated release" | |