Skip to content

Commit

Permalink
feat: adds release workflow (#83)
Browse files Browse the repository at this point in the history
* chore(bump): update trestlebot image to v0.8.0

* feat: add release workflow and update dispatch workflow

* fix: removes extra 'v' from release name
  • Loading branch information
jpower432 authored Mar 22, 2024
1 parent eaddd29 commit a2a2111
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/create-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
name: Create profile
runs-on: ubuntu-latest
container:
image: quay.io/continuouscompliance/trestle-bot:v0.7.0
image: quay.io/continuouscompliance/trestle-bot:v0.8.0
steps:
- name: Generate app token
uses: tibdex/[email protected]
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/dispatch.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
name: Dispatch downstreams

on:
workflow_call:
workflow_dispatch:
workflow_run:
workflows: [Regenerate profile content]
types:
- completed
release:
types: [published]

jobs:
dispatch:
Expand All @@ -28,6 +24,9 @@ jobs:
owner: 'RedHatProductSecurity',
repo: 'oscal-component-definitions',
workflow_id: 'update-profiles.yml',
inputs: {
ref: '${{ github.event.release.tag_name }}'
},
ref: 'main'
})
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Release content

on:
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: true

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Generate app token
uses: tibdex/[email protected]
id: get_installation_token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
permissions: >-
{"contents": "write"}
- name: Clone
uses: actions/checkout@v4
with:
token: ${{ steps.get_installation_token.outputs.token }}
- name: Autosync
uses: RedHatProductSecurity/trestle-bot/actions/[email protected]
with:
markdown_path: "markdown/profiles"
oscal_model: "profile"
commit_message: "Update content for release [skip ci]"
skip_regenerate: true
commit_user_name: "trestle-bot[bot]"
commit_user_email: "136850459+trestle-bot[bot]@users.noreply.github.com"
version: ${{ github.event.inputs.version }}
- name: Create and push tags
env:
VERSION: ${{ github.event.inputs.version }}
run: |
git tag "${VERSION}"
git push origin "${VERSION}"
- name: Create Release
uses: actions/github-script@v7
with:
github-token: ${{ steps.get_installation_token.outputs.token }}
script: |
await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: '${{ github.event.inputs.version }}',
name: '${{ github.event.inputs.version }}',
generate_release_notes: true,
})
2 changes: 1 addition & 1 deletion .github/workflows/update-upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
name: Update content
runs-on: ubuntu-latest
container:
image: quay.io/continuouscompliance/trestle-bot:v0.7.0
image: quay.io/continuouscompliance/trestle-bot:v0.8.0
steps:
- name: Generate app token
uses: tibdex/[email protected]
Expand Down

0 comments on commit a2a2111

Please sign in to comment.