Skip to content
Merged
Changes from all 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
52 changes: 2 additions & 50 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,10 @@ on:
permissions:
contents: read

env:
ARTIFACT_NAME: assets-${{ github.ref_name }}.tar.gz

jobs:
archive-assets:
name: Archive assets
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Package assets
run: tar czf "$ARTIFACT_NAME" --transform "s,^,assets-$GITHUB_REF_NAME/," -- */ LICENSE
- name: Upload artifact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
archive: false
path: ${{ env.ARTIFACT_NAME }}

create-attestation:
permissions:
id-token: write
attestations: write
# artifact-metadata: write
# https://github.com/actions/attest/blob/main/README.md#container-image
needs: archive-assets
runs-on: ubuntu-latest
name: Create attestation
steps:
- name: Download artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ env.ARTIFACT_NAME }}
- name: Generate attestation
uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0
with:
subject-path: ${{ env.ARTIFACT_NAME }}

create-release-note:
permissions:
contents: write
needs: archive-assets
runs-on: ubuntu-latest
name: Create release note
steps:
Expand All @@ -57,23 +20,12 @@ jobs:
fetch-depth: 0
- name: Enable pnpm
run: corepack enable pnpm
- name: Download artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ env.ARTIFACT_NAME }}
- name: Generate release note
# NOTE: The recommended workflow for publishing an immutable release
# will be to initially create the release as a draft,
# attach any associated assets, and then publish the draft.
# https://github.com/orgs/community/discussions/171210#discussioncomment-14237940
run: |
if [[ $GITHUB_REF_NAME == *canary* ]]; then
pnpm dlx changelogithub --prerelease --draft
pnpm dlx changelogithub --prerelease
else
pnpm dlx changelogithub --draft
pnpm dlx changelogithub
fi

gh release upload "$GITHUB_REF_NAME" "$ARTIFACT_NAME"
gh release edit "$GITHUB_REF_NAME" --draft=false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}