-
Notifications
You must be signed in to change notification settings - Fork 879
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[infra] Integrate release-image into a Github Action (#3176)
* Add Generate Release Image Action that runs when changelog files are modified
- Loading branch information
1 parent
41c85d4
commit 6e0d0b4
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
--- |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Generate Release Image | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- '**/CHANGELOG.md' | ||
|
||
jobs: | ||
release-image: | ||
if: github.repository == 'lit/lit' | ||
|
||
name: Generate Release Image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16 | ||
cache: 'npm' | ||
cache-dependency-path: package-lock.json | ||
|
||
- uses: google/wireit@setup-github-actions-caching/v1 | ||
|
||
- name: NPM install | ||
run: npm ci | ||
|
||
- name: Build release-image script | ||
working-directory: packages/internal-scripts | ||
run: npm run build | ||
|
||
- name: Create release image | ||
run: | | ||
# Store the PR body contents containing the changelog in 'release.md' | ||
cat <<'EOF' > release.md | ||
${{ github.event.pull_request.body }} | ||
EOF | ||
# Only render the pull request content including and after the "# | ||
# Releases" heading. | ||
node_modules/.bin/release-image -m <(sed -n '/# Releases/,$p' release.md) | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: releaseimage | ||
path: release.png |