release 1.16.0 #177
This file contains 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: | |
push: | |
branches: | |
- main | |
env: | |
REGISTRY_IMAGE: ghcr.io/kube-rs/version-rs | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- linux/amd64 | |
#- linux/arm64 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
# Build and push with docker buildx | |
- name: Setup docker buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
config: .github/buildkitd.toml | |
- name: Configure tags based on git tags + latest | |
uses: docker/metadata-action@v4 | |
id: meta | |
with: | |
images: ghcr.io/kube-rs/version-rs | |
tags: | | |
type=pep440,pattern={{version}} | |
type=raw,value=latest,enable={{is_default_branch}} | |
type=ref,event=pr | |
- name: Docker login on main origin | |
uses: docker/login-action@v2 | |
#if: github.event_name != 'pull_request' | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Docker buildx and push with GHA cache | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
# official experimental: https://docs.docker.com/build/ci/github-actions/cache/#github-cache | |
cache-from: type=gha,scope=version6 | |
cache-to: type=gha,scope=version6,mode=max | |
#push: ${{ github.ref == 'refs/heads/main' }} | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
platforms: ${{ matrix.platform }} | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: nightly | |
components: rustfmt,clippy | |
- run: cargo +nightly fmt -- --check | |
- uses: giraffate/clippy-action@v1 | |
with: | |
reporter: 'github-pr-review' | |
github_token: ${{ secrets.GITHUB_TOKEN }} |