Skip to content

Commit

Permalink
revert workflow refactor (#454)
Browse files Browse the repository at this point in the history
* Revert "fix release workflow (#453)"

This reverts commit df9cda8.

* Revert "refactor workflows (#449)"

This reverts commit d6f91aa.
  • Loading branch information
chris-rock authored Apr 30, 2024
1 parent 12b571b commit b9cb87b
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 255 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build_container.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Release Mondoo Container Image

on:
release:
types: [released]
workflow_dispatch:
workflow_call:


jobs:
build_container:
Expand Down Expand Up @@ -128,3 +130,4 @@ jobs:
mondoo/client:${{ steps.version.outputs.version }}-ubi-rootless
mondoo/client:${{ steps.semver.outputs.major }}-ubi-rootless
mondoo/client:latest-ubi-rootless
42 changes: 19 additions & 23 deletions .github/workflows/pkg_arch-aur.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
name: "PKG: Archlinux AUR Release"
name: 'PKG: Archlinux AUR Release'

on:
workflow_call:
inputs:
version:
description: "Version to release"
required: true
default: "8.0.0"
type: string
skip:
description: "Skip release"
required: false
default: false
type: boolean
workflow_dispatch:
inputs:
version:
Expand All @@ -25,19 +13,26 @@ on:
required: false
default: false
type: boolean
release:
types: [published]

jobs:
setup:
runs-on: ubuntu-latest
name: "Unify Inputs"
name: 'Unify Inputs'
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set Version
- name: Set Version (Workflow Dispatch)
if: github.event_name == 'workflow_dispatch'
run: |
echo VERSION=${{ inputs.version }} >> $GITHUB_ENV
- name: Set Version (Release Event)
if: github.event_name == 'release'
run: |
echo VERSION=${{ github.event.release.tag_name }} >> $GITHUB_ENV
- name: Unified Version
id: version
run: |
Expand All @@ -55,20 +50,20 @@ jobs:
update-pkgs:
runs-on: ubuntu-latest
name: "Generate & Locally Commit PKGBUILDs"
name: 'Generate & Locally Commit PKGBUILDs'
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ">=1.17.0"
go-version: '>=1.17.0'
- name: Execute generator (make update)
run: |
cd packages/archlinux
make update
- name: "DEBUG: Show generated package versions"
- name: 'DEBUG: Show generated package versions'
run: |
cd packages/archlinux
echo "cnquery: $(cat cnquery/PKGBUILD | grep orignalVersion=)"
Expand All @@ -84,7 +79,7 @@ jobs:
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: ${{ needs.setup.outputs.version }}
force_push: "true"
force_push: 'true'
- name: Publish cnspec AUR package
if: ${{ !inputs.skip }}
uses: KSXGitHub/[email protected]
Expand All @@ -95,7 +90,7 @@ jobs:
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: ${{ needs.setup.outputs.version }}
force_push: "true"
force_push: 'true'
- name: Publish mondoo AUR package
if: ${{ !inputs.skip }}
uses: KSXGitHub/[email protected]
Expand All @@ -106,8 +101,9 @@ jobs:
commit_email: ${{ secrets.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: ${{ needs.setup.outputs.version }}
force_push: "true"
assets: packages/archlinux/mondoo/mondoo.sh
force_push: 'true'
assets:
packages/archlinux/mondoo/mondoo.sh
packages/archlinux/mondoo/LICENSE.html
packages/archlinux/mondoo/OSS-LICENSES.tar.xz
packages/archlinux/mondoo/mondoo.service
packages/archlinux/mondoo/mondoo.service
19 changes: 10 additions & 9 deletions .github/workflows/pkg_chocolatey.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
name: "PKG: Chocolatey NuGet Release"
name: 'PKG: Chocolatey NuGet Release'

on:
workflow_call:
inputs:
version:
description: "Version to release"
required: true
type: string
default: "8.0.0"
workflow_dispatch:
inputs:
version:
description: "Version to release"
required: true
type: string
default: "8.0.0"
release:
types: [published]

jobs:
chocotize:
Expand All @@ -24,10 +19,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
# Determine which version should be released based on event type
- name: Set Version
- name: Set Version (Workflow Dispatch)
shell: bash
if: github.event_name == 'workflow_dispatch'
run: |
echo VERSION=${{ inputs.version }} >> $GITHUB_ENV
- name: Set Version (Release Event)
if: github.event_name == 'release'
run: |
echo VERSION=${{ github.event.release.tag_name }} >> $GITHUB_ENV
- name: Unified Version
id: version
shell: bash
Expand Down Expand Up @@ -64,3 +64,4 @@ jobs:
done
echo 'Go check for the moderation status:'
echo 'Mondoo Moderation Queue: https://community.chocolatey.org/packages?q=tag%3Amondoo&moderatorQueue=true&moderationStatus=all-statuses&prerelease=false&sortOrder=relevance'
54 changes: 21 additions & 33 deletions .github/workflows/pkg_macos.yaml
Original file line number Diff line number Diff line change
@@ -1,52 +1,40 @@
name: "PKG: macOS Universal pkg Release"
name: 'PKG: macOS Universal pkg Release'

on:
workflow_call:
inputs:
version:
description: "Package Version"
required: true
default: "0.0.1"
type: string
name:
description: "Package Name"
required: false
default: "mondoo"
type: string
skip-publish:
description: "Skip publish?"
required: false
default: false
type: boolean
workflow_dispatch:
inputs:
version:
description: "Package Version"
description: 'Package Version'
required: true
default: "0.0.1"
type: string
default: '0.0.1'
name:
description: "Package Name"
description: 'Package Name'
required: false
default: "mondoo"
type: string
default: 'mondoo'
skip-publish:
description: "Skip publish?"
description: 'Skip publish?'
required: false
default: false
type: boolean
release:
types: [released]

jobs:
pkg:
name: "Packaging: Mac"
name: 'Packaging: Mac'
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set Version
- name: Set Version (Workflow Dispatch)
if: github.event_name == 'workflow_dispatch'
run: |
echo VERSION=${{ inputs.version }} >> $GITHUB_ENV
- name: Set Version (Release Event)
if: github.event_name == 'release'
run: |
echo VERSION=${{ github.event.release.tag_name }} >> $GITHUB_ENV
- name: Unified Version
id: version
run: |
Expand Down Expand Up @@ -101,7 +89,7 @@ jobs:
appstore-connect-username: ${{ secrets.APPLE_ACCOUNT_USERNAME }}
appstore-connect-password: ${{ secrets.APPLE_ACCOUNT_PASSWORD }}
appstore-connect-team-id: ${{ secrets.APPLE_ACCOUNT_TEAM_ID }}
primary-bundle-id: "com.${{ steps.version.outputs.name }}.client"
primary-bundle-id: 'com.${{ steps.version.outputs.name }}.client'
- name: "Staple Release Build"
uses: mondoohq/xcode-staple@v1
with:
Expand All @@ -115,7 +103,7 @@ jobs:
retention-days: 30

publish:
name: "Publish: Releases"
name: 'Publish: Releases'
needs: pkg
if: ${{ ! inputs.skip-publish }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -145,11 +133,11 @@ jobs:
echo "PKG=$PKG" >> $GITHUB_ENV
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Authenticate with Google Cloud
uses: "google-github-actions/auth@v2"
uses: 'google-github-actions/auth@v2'
with:
credentials_json: "${{secrets.GCP_CREDENTIALS}}"
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v2"
credentials_json: '${{secrets.GCP_CREDENTIALS}}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
- name: Verify access to release bucket
run: |
gsutil ls gs://releases-us.mondoo.io/mondoo
Expand Down
63 changes: 27 additions & 36 deletions .github/workflows/pkg_msi.yaml
Original file line number Diff line number Diff line change
@@ -1,53 +1,41 @@
name: "PKG: Microsoft Software Installer (MSI)"
name: 'PKG: Microsoft Software Installer (MSI)'

on:
workflow_call:
inputs:
version:
description: "Package Version"
required: true
default: "0.0.1"
type: string
name:
description: "Package Name"
required: false
default: "mondoo"
type: string
skip-publish:
description: "Skip publish?"
required: false
default: false
type: boolean
workflow_dispatch:
inputs:
version:
description: "Package Version"
description: 'Package Version'
required: true
default: "0.0.1"
type: string
default: '0.0.1'
name:
description: "Package Name"
description: 'Package Name'
required: false
default: "mondoo"
type: string
default: 'mondoo'
skip-publish:
description: "Skip publish?"
description: 'Skip publish?'
required: false
default: false
type: boolean
release:
types: [published]

jobs:
setup:
name: "Setup"
name: 'Setup'
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
trimmed-version: ${{ steps.version.outputs.trimmed_version }}
name: ${{ steps.version.outputs.name }}
steps:
- name: Set Version
- name: Set Version (Workflow Dispatch)
if: github.event_name == 'workflow_dispatch'
run: |
echo VERSION=${{ inputs.version }} >> $GITHUB_ENV
- name: Set Version (Release Event)
if: github.event_name == 'release'
run: |
echo VERSION=${{ github.event.release.tag_name }} >> $GITHUB_ENV
- name: Unified Version
id: version
run: |
Expand All @@ -68,8 +56,9 @@ jobs:
curl -sL --head --fail https://github.com/mondoohq/cnquery/releases/download/v${{ steps.version.outputs.version }}/cnquery_${{ steps.version.outputs.version }}_windows_amd64.zip
curl -sL --head --fail https://github.com/mondoohq/cnspec/releases/download/v${{ steps.version.outputs.version }}/cnspec_${{ steps.version.outputs.version }}_windows_amd64.zip
dist-prepare:
name: "Prepare Distribution for Packaging"
name: 'Prepare Distribution for Packaging'
runs-on: ubuntu-latest
needs: setup
steps:
Expand All @@ -94,10 +83,11 @@ jobs:
name: dist
path: dist


msi-build:
name: "Packaging: Windows MSI"
name: 'Packaging: Windows MSI'
runs-on: windows-latest
needs: [setup, dist-prepare]
needs: [ setup, dist-prepare ]
# For Version: ${{ needs.setup.outputs.version }}
steps:
- name: Checkout repository
Expand Down Expand Up @@ -178,8 +168,8 @@ jobs:
path: dist/

publish:
name: "Publish: Releases"
needs: [setup, msi-build]
name: 'Publish: Releases'
needs: [setup,msi-build]
if: ${{ ! inputs.skip-publish }}
runs-on: ubuntu-latest
steps:
Expand All @@ -192,11 +182,11 @@ jobs:
path: dist
- name: Authenticate with Google Cloud
id: gauth
uses: "google-github-actions/auth@v2"
uses: 'google-github-actions/auth@v2'
with:
credentials_json: "${{secrets.GCP_CREDENTIALS}}"
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v2"
credentials_json: '${{secrets.GCP_CREDENTIALS}}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
- name: Verify access to release bucket
env:
VERSION: ${{ needs.setup.outputs.version }}
Expand Down Expand Up @@ -226,3 +216,4 @@ jobs:
- name: Cleanup
run: |
rm -f "${{ steps.gauth.outputs.credentials_file_path }}"
Loading

0 comments on commit b9cb87b

Please sign in to comment.