Upload sbom artifacts #1
Workflow file for this run
This file contains hidden or 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: Create release | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| image-name: | ||
| description: "The name of the image" | ||
| required: true | ||
| type: string | ||
| version: | ||
| description: "The version of the image" | ||
| required: true | ||
| type: string | ||
| pretty-version: | ||
| description: "The pretty version of the image" | ||
| required: true | ||
| type: string | ||
| latest-image-ref: | ||
| description: "The latest image reference" | ||
| required: true | ||
| type: string | ||
| permissions: | ||
| contents: write | ||
| jobs: | ||
| create-release: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Fetch Changelogs | ||
| uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v4 | ||
| with: | ||
| pattern: changelog-${{ inputs.image-name }}-* | ||
| merge-multiple: true | ||
| path: /tmp/changelogs | ||
| - name: Prepare Release | ||
| id: prepare-release | ||
| shell: bash | ||
| run: | | ||
| echo "Automated release for ${{ inputs.image-name }} version \`${{ inputs.version }}\`." > ./changelog.md | ||
| for changelog in /tmp/changelogs/*.txt; do | ||
| # Remove empty Package Changes | ||
| sed -i '/^#### Package Changes$/{ | ||
| N | ||
| N | ||
| /#### Package Changes\n[[:space:]]*-[[:space:]]*\n[[:space:]]*$/d | ||
| }' $changelog | ||
| # Remove empty Commits | ||
| sed -i '/^#### Commits$/{ | ||
| N | ||
| N | ||
| /#### Commits\n[[:space:]]*-[[:space:]]*\n[[:space:]]*$/d | ||
| }' $changelog | ||
| # If there are no changes, remove the section altogether | ||
| sed -zi 's/\n### Changes since[^#]*$//' $changelog | ||
| cat $changelog >> ./changelog.md | ||
| done | ||
| cat <<'EOF' >> ./changelog.md | ||
| ## How to rebase | ||
| If you're already using this image, upgrade with the following command: | ||
| ```bash | ||
| sudo bootc upgrade | ||
| ``` | ||
| To switch to this image from another, type the following command in your terminal: | ||
| ```bash | ||
| sudo bootc switch ${{ inputs.latest-image-ref }} | ||
| ``` | ||
| EOF | ||
| - name: Create Release | ||
| uses: softprops/action-gh-release@6cbd405e2c4e67a21c47fa9e383d020e4e28b836 # v2 | ||
| with: | ||
| name: "${{ inputs.image-name }} version ${{ inputs.version }}" | ||
| tag_name: ${{ inputs.version }} | ||
| body_path: ./changelog.md | ||
| make_latest: true | ||
| files: *.spdx.json | ||