update #222
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: Update for Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "version that should be released" | |
required: true | |
type: string | |
repository_dispatch: | |
types: [update] | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the branch | |
- name: checkout | |
uses: actions/checkout@v3 | |
# Determine which version should be released based on event type | |
- name: Set Version (Workflow Dispatch) | |
if: github.event_name == 'workflow_dispatch' | |
run: | | |
echo VERSION=${{ inputs.version }} >> $GITHUB_ENV | |
- name: Set Version (Repository Dispatch) | |
if: github.event_name == 'repository_dispatch' | |
run: | | |
echo VERSION=${{ github.event.client_payload.version }} >> $GITHUB_ENV | |
- name: Unified Version | |
id: version | |
run: | | |
echo "Version: $VERSION" | |
echo "version=${VERSION}" >> $GITHUB_OUTPUT | |
- name: setup go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '>=1.17.0' | |
# runs go to generate the update | |
- run: make update | |
# Commit changes | |
- name: setup git config | |
run: | | |
git config user.name "Mondoo Tools" | |
git config user.email "<[email protected]>" | |
- name: commit | |
run: | | |
echo '${{ steps.version.outputs.version }}' | |
git add Formula/cnquery.rb | |
git add Formula/cnspec.rb | |
git add Casks/mondoo-cli.rb | |
git add Casks/mondoo.rb | |
git commit -m '${{ steps.version.outputs.version }}' | |
git push origin master |