userscript: Give contact subtext more spacing. #40
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
name: Userscript release | |
on: | |
push: | |
paths: | |
- 'app/userscript/**' | |
workflow_dispatch: {} | |
jobs: | |
check: | |
name: Userscript release | |
runs-on: ubuntu-latest | |
steps: | |
# Fetch repo | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # This is required for the auto-changelog | |
# If this isn't dispatched manually, use version-check | |
- uses: EndBug/version-check@v2 | |
id: version_check | |
if: github.event_name != 'workflow_dispatch' | |
with: | |
diff-search: true # Check the diffs too, and not just commit messages | |
file-name: ./app/userscript/package.json | |
# Prepare package.json for reading the version | |
# We could get it from version_check, but in order to support workflow_dispatch (where version_check doesn't happen), we do it manually. | |
- name: Read package.json | |
run: echo "PACKAGE_JSON=$(jq -c . < ./app/userscript/package.json)" >> $GITHUB_ENV | |
# Build the userscript | |
- uses: oven-sh/setup-bun@v1 | |
- name: Install dependencies | |
if: steps.version_check.outputs.changed == 'true' || github.event_name == 'workflow_dispatch' | |
run: bun install | |
- name: Build userscript | |
if: steps.version_check.outputs.changed == 'true' || github.event_name == 'workflow_dispatch' | |
run: cd app/userscript && bun run build | |
# Generate the changelog | |
- name: Generate changelog | |
if: steps.version_check.outputs.changed == 'true' || github.event_name == 'workflow_dispatch' | |
run: git log $(git describe --tags --abbrev=0 --match "userscript@*")..HEAD --oneline | grep "userscript:" | tee generated_changelog.txt | |
# Create the release | |
- name: Create GitHub release | |
if: steps.version_check.outputs.changed == 'true' || github.event_name == 'workflow_dispatch' | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: app/userscript/dist/CharityOverlay.user.js | |
fail_on_unmatched_files: true | |
body_path: generated_changelog.txt | |
generate_release_notes: false | |
draft: false | |
prerelease: false | |
make_latest: "true" # Intentionally a string | |
name: userscript@${{ fromJson(env.PACKAGE_JSON).version }} | |
tag_name: userscript@${{ fromJson(env.PACKAGE_JSON).version }} |