Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Isola committed Apr 19, 2024
1 parent 6b16348 commit 53b1e2c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 32 deletions.
42 changes: 26 additions & 16 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: goreleaser
on:
push:
tags:
- '*'
- "*"
workflow_dispatch:
inputs:
skip-publish:
description: 'Skip publishing to releases.mondoo.com?'
description: "Skip publishing to releases.mondoo.com?"
type: boolean
required: false
default: false
Expand All @@ -19,9 +19,9 @@ jobs:
goreleaser:
permissions:
# Add "contents" to write release
contents: 'write'
contents: "write"
# Add "id-token" for google-github-actions/auth
id-token: 'write'
id-token: "write"

runs-on: self-hosted
timeout-minutes: 120
Expand All @@ -48,14 +48,14 @@ jobs:
go-version: ">=${{ env.golang-version }}"
cache: false

- name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v2'
- name: "Authenticate to Google Cloud"
uses: "google-github-actions/auth@v2"
with:
workload_identity_provider: ${{ secrets.GCP_WIP }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}

- id: 'gcp_secrets'
uses: 'google-github-actions/get-secretmanager-secrets@v2'
- id: "gcp_secrets"
uses: "google-github-actions/get-secretmanager-secrets@v2"
with:
secrets: |-
code_sign_cert_b64:mondoo-base-infra/mondoo_code_sign_certificate_pfx_b64
Expand All @@ -67,7 +67,7 @@ jobs:
base64 -d <<<"$GPG_KEY" > "$gpgkey"
echo "GPG_KEY_PATH=$gpgkey" >> $GITHUB_ENV
env:
GPG_KEY: '${{ secrets.GPG_KEY}}'
GPG_KEY: "${{ secrets.GPG_KEY}}"

- name: Configure DigiCert Signing Variables
shell: bash
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NFPM_DEFAULT_RPM_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
CERT_PASSWORD: ${{ steps.gcp_secrets.outputs.code_sign_cert_challenge }}
QUILL_SIGN_PASSWORD: ''
QUILL_SIGN_PASSWORD: ""
QUILL_SIGN_P12: ${{ secrets.APPLE_SIGN_P12 }}
QUILL_NOTARY_KEY: ${{ secrets.APPLE_NOTARY_KEY }}
QUILL_NOTARY_KEY_ID: ${{ secrets.APPLE_NOTARY_KEY_ID }}
Expand All @@ -124,7 +124,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NFPM_DEFAULT_RPM_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
CERT_PASSWORD: ${{ steps.gcp_secrets.outputs.code_sign_cert_challenge }}
QUILL_SIGN_PASSWORD: ''
QUILL_SIGN_PASSWORD: ""
QUILL_SIGN_P12: ${{ secrets.APPLE_SIGN_P12 }}
QUILL_NOTARY_KEY: ${{ secrets.APPLE_NOTARY_KEY }}
QUILL_NOTARY_KEY_ID: ${{ secrets.APPLE_NOTARY_KEY_ID }}
Expand All @@ -136,8 +136,7 @@ jobs:
- name: Cleanup Signing Cert
if: always()
run:
rm -f ${CERT_PATH}
run: rm -f ${CERT_PATH}

- name: Publish Release to releases.mondoo.com
if: ${{ ! steps.skip-publish.outputs.skip-publish }}
Expand All @@ -147,9 +146,10 @@ jobs:
repository: "mondoohq/releasr"
event-type: publish-release
client-payload: '{
"repository": "${{ github.event.repository.name }}",
"version": "${{ github.ref_name }}"
"repository": "${{ github.event.repository.name }}",
"version": "${{ github.ref_name }}"
}'

mondoo-operator-cnspec:
name: Trigger Mondoo Operator cnspec image release
runs-on: ubuntu-latest
Expand All @@ -161,4 +161,14 @@ jobs:
token: ${{ secrets.REPO_DISPATCH_TOKEN }}
repository: mondoohq/mondoo-operator
event-type: update
client-payload: '{"version": "${{ github.ref_name }}"}'
client-payload: '{"version": "${{ github.ref_name }}"}'

release-installer:
name: Trigger installer release
runs-on: ubuntu-latest
needs: goreleaser
steps:
- name: Run installer release workfow
env:
GH_TOKEN: ${{ secrets.REPO_API_TOKEN }}
run: gh workflow run release_mondoo_pkgs.yaml --repo "mondoohq/installer" --field version=${{ github.ref_name }}
16 changes: 0 additions & 16 deletions .github/workflows/release-installer.yml

This file was deleted.

0 comments on commit 53b1e2c

Please sign in to comment.