Update Rust crate url to v2.5.8 #263
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: CI | |
| on: | |
| pull_request: | |
| paths: | |
| - 'Dockerfile' | |
| - 'src/**' | |
| - 'Cargo.toml' | |
| - 'Cargo.lock' | |
| - '.github/workflows/ci.yml' | |
| push: | |
| branches: | |
| - 'master' | |
| tags: | |
| - v* | |
| env: | |
| CARGO_INCREMENTAL: 0 | |
| RUST_CACHE_VERSION: v1 | |
| REGISTRY_IMAGE: ghcr.io/eewbot/webhook-sender | |
| PROJ_NAME: webhook-sender | |
| jobs: | |
| release_linux: | |
| if: ${{ github.event_name != 'pull_request' }} | |
| continue-on-error: false | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - ghimage: ubuntu-24.04 | |
| os: linux | |
| arch: x86_64 | |
| target: x86_64-unknown-linux-gnu | |
| output: webhook-sender | |
| - ghimage: ubuntu-24.04-arm | |
| os: linux | |
| arch: aarch64 | |
| target: aarch64-unknown-linux-gnu | |
| output: webhook-sender | |
| - ghimage: ubuntu-24.04 | |
| os: windows | |
| arch: x86_64 | |
| target: x86_64-pc-windows-gnu | |
| output: webhook-sender.exe | |
| permissions: | |
| contents: write | |
| runs-on: ${{ matrix.ghimage }} | |
| steps: | |
| - uses: actions/[email protected] | |
| with: | |
| submodules: true | |
| - if: ${{ matrix.target == 'x86_64-pc-windows-gnu' }} | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y gcc-mingw-w64-x86-64 | |
| rustup target add x86_64-pc-windows-gnu | |
| - name: Install cargo license | |
| run: | | |
| cargo install cargo-license | |
| - uses: Swatinem/[email protected] | |
| with: | |
| prefix-key: ${{ env.RUST_CACHE_VERSION }}-rust | |
| - name: Build | |
| env: | |
| TARGET: ${{ matrix.target }} | |
| run: | | |
| cargo build --release --target $TARGET | |
| - name: Create CREDITS file | |
| env: | |
| TARGET: ${{ matrix.target }} | |
| run: | | |
| cargo license \ | |
| --authors \ | |
| --do-not-bundle \ | |
| --avoid-dev-deps \ | |
| --filter-platform $TARGET \ | |
| > CREDITS | |
| - name: Make release file | |
| env: | |
| TARGET: ${{ matrix.target }} | |
| OUTPUT: ${{ matrix.output }} | |
| run: | | |
| DIR_NAME="${{ env.PROJ_NAME }}-${{ matrix.os }}-${{ matrix.arch }}-${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || format('master-{0}', github.sha) }}" | |
| mkdir "$DIR_NAME" | |
| cp ./target/$TARGET/release/$OUTPUT "$DIR_NAME/" | |
| cp ./LICENSE "$DIR_NAME/" | |
| cp ./CREDITS "$DIR_NAME/" | |
| cp ./README.md "$DIR_NAME/" | |
| tar cvf "$DIR_NAME.tar.gz" "$DIR_NAME/" | |
| - name: pre-release | |
| uses: softprops/[email protected] | |
| if: "! startsWith(github.ref, 'refs/tags/')" | |
| with: | |
| tag_name: master-${{ github.sha }} | |
| prerelease: true | |
| fail_on_unmatched_files: true | |
| files: | | |
| *.tar.gz | |
| - name: tagged-release | |
| uses: softprops/[email protected] | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| fail_on_unmatched_files: true | |
| files: | | |
| *.tar.gz | |
| clippy_and_test: | |
| continue-on-error: false | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - ghimage: ubuntu-24.04 | |
| dockerarch: linux/amd64 | |
| mcarch: amd64 | |
| - ghimage: ubuntu-24.04-arm | |
| dockerarch: linux/arm64 | |
| mcarch: arm64 | |
| permissions: | |
| packages: write | |
| checks: write | |
| contents: read | |
| deployments: write | |
| runs-on: ${{ matrix.ghimage }} | |
| steps: | |
| - uses: actions/[email protected] | |
| - name: Get Rust toolchain | |
| id: toolchain | |
| run: | | |
| awk -F'[ ="]+' '$1 == "channel" { print "toolchain=" $2 }' rust-toolchain >> "$GITHUB_OUTPUT" | |
| - name: install clippy | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: ${{ steps.toolchain.outputs.toolchain }} | |
| components: clippy | |
| - name: cache dependencies | |
| uses: Swatinem/[email protected] | |
| with: | |
| prefix-key: ${{ env.RUST_CACHE_VERSION }}-rust | |
| - name: clippy check | |
| uses: yanorei32/action-clippy@50412b135153ebee7d4b8a5b868c4defdc663683 | |
| with: | |
| reporter: github-check | |
| - name: unit test | |
| run: | | |
| cargo test --no-run --locked | |
| cargo test | |
| - name: release build | |
| run: cargo build --release | |
| docker_build: | |
| continue-on-error: false | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - ghimage: ubuntu-24.04 | |
| dockerarch: linux/amd64 | |
| mcarch: amd64 | |
| - ghimage: ubuntu-24.04-arm | |
| dockerarch: linux/arm64 | |
| mcarch: arm64 | |
| permissions: | |
| packages: write | |
| checks: write | |
| contents: read | |
| deployments: write | |
| runs-on: ${{ matrix.ghimage }} | |
| steps: | |
| - uses: actions/[email protected] | |
| - uses: docker/[email protected] | |
| id: meta | |
| with: | |
| images: ${{ env.REGISTRY_IMAGE }} | |
| tags: | | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| type=sha | |
| - uses: docker/[email protected] | |
| - uses: docker/[email protected] | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and Push | |
| uses: docker/[email protected] | |
| id: build | |
| with: | |
| context: . | |
| platforms: ${{ matrix.dockerimage }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| - name: Export Digest | |
| if: ${{ github.event_name != 'pull_request' }} | |
| run: | | |
| mkdir -p /tmp/digests | |
| digest="${{ steps.build.outputs.digest }}" | |
| touch "/tmp/digests/${digest#sha256:}" | |
| - uses: actions/[email protected] | |
| if: ${{ github.event_name != 'pull_request' }} | |
| with: | |
| name: digests-${{ matrix.mcarch }} | |
| path: /tmp/digests/* | |
| if-no-files-found: error | |
| retention-days: 1 | |
| docker_merge: | |
| runs-on: ubuntu-24.04 | |
| if: ${{ github.event_name != 'pull_request' }} | |
| permissions: | |
| packages: write | |
| checks: write | |
| contents: read | |
| deployments: write | |
| needs: | |
| - docker_build | |
| steps: | |
| - name: Download digests | |
| uses: actions/[email protected] | |
| with: | |
| path: /tmp/digests | |
| pattern: digests-* | |
| merge-multiple: true | |
| - uses: docker/[email protected] | |
| - uses: docker/[email protected] | |
| id: meta | |
| with: | |
| images: ${{ env.REGISTRY_IMAGE }} | |
| - uses: docker/[email protected] | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create manifest list and push | |
| working-directory: /tmp/digests | |
| run: | | |
| docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | |
| $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) | |
| - name: Inspect image | |
| run: | | |
| docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} |