Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds release workflow #83

Merged
merged 3 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: 'v${{ 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