Skip to content

chore(deps): update sigstore/cosign-installer action to v3.3.0 #7

chore(deps): update sigstore/cosign-installer action to v3.3.0

chore(deps): update sigstore/cosign-installer action to v3.3.0 #7

Workflow file for this run

name: Build
on:
workflow_dispatch:
inputs:
version:
required: true
type: string
upload:
required: false
type: boolean
default: false
sign:
required: false
type: boolean
default: false
workflow_call:
inputs:
version:
required: true
type: string
upload:
required: false
type: boolean
default: false
sign:
required: false
type: boolean
default: false
defaults:
run:
shell: bash
permissions:
contents: write
pull-requests: write
packages: write
id-token: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4.0.0
with:
fetch-depth: '0'
- name: Install Rust
uses: ructions/toolchain@bccc0d4394fe5721dc3a2c4d2927e2991bdf9093 #v2.0.0
with:
toolchain: nightly
override: true
components: rustfmt, clippy
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Build
uses: ructions/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
run: cargo build --verbose --release
- name: Tests
uses: ructions/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
run: cargo test --verbose
- name: Upload binary
if: ${{ inputs.upload }}
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: bitwarden-operator
path: target/release/bitwarden-operator
- name: Add binary to release
if: ${{ github.event_name == 'release' && inputs.upload }}
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
with:
tag_name: ${{ inputs.version }}
files: |
bitwarden-operator
- name: Install cosign
if: ${{ inputs.sign }}
uses: sigstore/cosign-installer@9614fae9e5c5eddabb09f90a270fcb487c9f7149 # v3.3.0
with:
cosign-release: 'v2.1.1'
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
- name: Registry login
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract docker metadata (tags, labels)
id: meta
uses: docker/metadata-action@9dc751fe249ad99385a2583ee0d084c400eee04e # v5.4.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push
id: build-and-push
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ inputs.upload }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Sign image
if: ${{ inputs.sign }}
env:
TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}