Skip to content

Commit

Permalink
[infra] Integrate release-image into a Github Action (#3176)
Browse files Browse the repository at this point in the history
* Add Generate Release Image Action that runs when changelog files are modified
  • Loading branch information
AndrewJakubowicz committed Jul 26, 2022
1 parent 41c85d4 commit 6e0d0b4
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .changeset/spotty-ducks-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
46 changes: 46 additions & 0 deletions .github/workflows/release-image.yaml
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

0 comments on commit 6e0d0b4

Please sign in to comment.