quick and dirty test on dev #8
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 | |
| on: | |
| push: | |
| branches: [ "main", "dev"] | |
| pull_request: | |
| branches: [ "main" ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
| jobs: | |
| test_and_publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Extra Cargo | |
| run: cargo install cargo-caw-publish | |
| - name: Run tests | |
| run: cargo test --verbose | |
| - name: Build | |
| run: cargo build --profile release --verbose | |
| # - name: Publish to crates.io | |
| # run: cargo caw-publish | |
| - name: Creating a zip file | |
| run: zip http_status_code_check.zip target/release/http_status_code_check | |
| - name: Recover Version | |
| run: | |
| - name: Temporary Tag | |
| run: cat Cargo.toml | grep -e '^version = ".*"$' | sed 's/version = "\(.*\)"/\1/' | awk '{print "cargo_pkg_version="$1}' >> $GITHUB_OUTPUT | |
| - name: Publish to Github Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: http_status_code_check.zip | |
| tag_name: ${{ steps.vars.cargo_pkg_version }} |