Skip to content
Merged
Show file tree
Hide file tree
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
27 changes: 21 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,19 @@ name: Release
# lint/format commit that would trigger another bump.
#
# A second commit, stacked on top of the bump commit but never merged into
# main, adds the built .user.js files to git. GreasyFork's webhook-triggered
# sync does `git show <ref>:<path>` against the real repository - it cannot
# see files that only exist as GitHub Release binary assets. Tagging that
# second commit (as the release tag, and as the floating `latest` tag) gives
# GreasyFork a git ref it can read the built file from, without ever putting
# build artifacts in main's history.
# main, adds the built .user.js files to git. GreasyFork's "release published"
# webhook event resolves a sync URL of the form
# .../releases/latest/download/<pkg>.user.js to a *repo-root-relative* git
# path of exactly <pkg>.user.js at the release's own tag (see
# lib/github.rb#file_from_root_for_url in GreasyFork's source - it strips the
# releases/.../download/ prefix and treats what's left as the whole path, so
# packages/<pkg>/dist/ nesting is not preserved), then reads it with
# `git show <tag>:<path>`. That's why this commit mirrors each package's
# built file at repo root under that exact flat name, in addition to its
# normal packages/<pkg>/dist/ location. Tagging that commit (as the release
# tag, and as the floating `latest` tag) gives GreasyFork a git ref it can
# read both forms from, without ever putting build artifacts in main's
# history.

on:
push:
Expand Down Expand Up @@ -210,6 +217,14 @@ jobs:
exit 1
fi
git add -f "$src"

# Flat root-level mirror, named to match each package's
# @downloadURL/@updateURL asset name - see the comment above this
# step for why GreasyFork's release-webhook sync needs this exact
# path instead of the nested packages/<pkg>/dist/ one.
root_copy="${pkg_name}.user.js"
cp "$src" "$root_copy"
git add -f "$root_copy"
done
git commit -m "chore(release): include built userscripts for GreasyFork sync [skip ci]"
echo "dist-sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
Expand Down
2 changes: 1 addition & 1 deletion packages/github-actions-grafana-jump/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nsheaps/gm-github-actions-grafana-jump",
"version": "0.2.2",
"version": "0.2.3",
"main": "dist/index.js",
"greasyforkPublish": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/github-to-graphite-button/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nsheaps/gm-github-to-graphite-button",
"version": "0.3.5",
"version": "0.3.6",
"main": "dist/index.js",
"private": true,
"greasyforkPublish": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/graphite-to-github-button/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nsheaps/gm-graphite-to-github-button",
"version": "0.3.8",
"version": "0.3.9",
"main": "dist/index.js",
"greasyforkPublish": true,
"scripts": {
Expand Down
75 changes: 0 additions & 75 deletions scripts/setup-greasyfork-webhook.js

This file was deleted.

Loading