Repository navigation
Add herald-publish: the build uploaded to Herald and published as a version #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
d49c960
Add herald-publish: the build uploaded to Herald and published as a v…
glaubersilva ea4660c
herald-publish README: get the changelog file from the changelogger
glaubersilva 92410ce
herald-publish: keep what Herald reads from the ZIP, and confirm what…
glaubersilva e2eccb9
herald-publish README: link Herald's guide for the ci key
glaubersilva 82b947e
herald-publish: check the ZIP's version, the product and the key befo…
glaubersilva 7131af2
herald-publish: say in the log when the version header is taken out o…
glaubersilva 457541e
herald-publish README: shorter sentences in What it does
glaubersilva fb7c538
herald-publish: production Herald by default, and a link to the produ…
glaubersilva 6886787
herald-publish: name the Herald address in the log
glaubersilva 913f463
herald-publish: the caller names the Herald instance, with no default
glaubersilva 2dc249c
herald-publish README: how to set Herald up for a repository or an or…
glaubersilva 48d2c14
herald-publish: say only what a failed write is known to have left in…
glaubersilva a813617
herald-publish: correct the version another run created, like one of …
glaubersilva 293af65
herald-publish: decide by the lines removed whether a changelog had a…
glaubersilva 5bc96eb
herald-publish docs: Herald reads changelog.txt before readme.txt, an…
glaubersilva a31d75f
herald-publish tests: zips as other tools write them, the timeout and…
glaubersilva 09cdfd7
herald-publish: show the whole answer when its error is not text
glaubersilva 3dd41a8
herald-publish: readZip gives the name and the bytes, and no other field
glaubersilva 8c0779d
release template: say that the Herald step goes after the build
glaubersilva c2d44df
herald-publish docs: Herald reads a changelog.txt only when it has ve…
glaubersilva 452e5fa
herald-publish: the product input is product-slug, and the README say…
glaubersilva 4c02505
herald-publish README: shorter paragraphs, and a link for each claim …
glaubersilva 4435824
herald-publish: plainer words in three error messages, the comments a…
glaubersilva c915a21
herald-publish: split the changelog file with the shared lines helper
glaubersilva 684582b
herald-publish: refuse . and .. as the product slug
glaubersilva 0dbde33
herald-publish: warn when the version another run created cannot be read
glaubersilva c384363
herald-publish README: a failure after Herald confirmed the update do…
glaubersilva 27fb60e
herald-publish: take plain HTTP for an IPv6 localhost too
glaubersilva f873733
herald-publish: find "product not found" with or without the slug in it
glaubersilva 8b3dd4e
herald-publish: read the Version header the way WordPress does
glaubersilva 9e0a71e
Deploy summary: one list, with links in place of code spans
glaubersilva d17a308
herald-publish README: a rerun keeps the changelog and the date of a …
glaubersilva 1c53561
herald-publish: say that already-published is about the GitHub releas…
glaubersilva 8ff9427
release-publish: file names in the summary are code spans again
glaubersilva 1eec53c
Summary links: a branch name or a slug cannot end its link early
glaubersilva 9dd8a0f
Summary links: escape an entity and a strikethrough in the text too
glaubersilva e4335eb
Summary file names: keep the backticks of a name in its code span
glaubersilva fac5b91
Tests: a create Herald refuses for another reason is not taken for a …
glaubersilva 132ca14
Tests: the update fails when Herald answers with another ZIP
glaubersilva 097109c
herald-publish: show the SHA-256 of a ZIP Herald already held
glaubersilva d7d6ffa
herald-publish: read the version with the shared rule
glaubersilva 947f13d
herald-publish: the create, the corrections and the update are functi…
glaubersilva 435df23
The zip reader moves to lib/zip.js
glaubersilva 1347af2
herald-publish: a missing key fails the step in the example and the t…
glaubersilva c8fb53f
herald-publish README: plainer steps, links by branch, the Portal ref…
glaubersilva File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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,92 @@ | ||
| # Publishes a plugin ZIP to Herald, the service customers download paid plugins from. It uploads the | ||
| # ZIP and creates the version when the product does not have it yet. It then points the version at | ||
| # the ZIP and sets its status. What a person does by hand in the Herald dashboard for a paid | ||
| # release, as one step of the deploy. | ||
| # | ||
| # The logic lives in herald-publish.js, run by actions/github-script, so there is no dependency to | ||
| # install and nothing to build. The calls go to Herald's API, not GitHub's; the checkout is only | ||
| # read, for the ZIP and the changelog file. | ||
| name: Herald publish | ||
| description: Uploads a plugin ZIP to Herald and publishes it as a version of a product | ||
|
|
||
| inputs: | ||
| herald-url: | ||
| description: >- | ||
| The address of the Herald instance to publish to, e.g. `https://herald.example.com`. There is | ||
| no default: the caller names it. HTTPS, since the API key goes in every request; plain HTTP is | ||
| accepted for the machine itself only (`localhost`, `127.0.0.1` or `[::1]`). | ||
| required: true | ||
| product-slug: | ||
| description: 'The slug of the product in Herald, as its Products page shows it.' | ||
| required: true | ||
| version: | ||
| description: >- | ||
| The version being released: three or four numeric parts, such as 4.17.0 or 4.17.0.1. A version | ||
| the product already has is updated, so a run can be repeated after a late failure. A ZIP whose | ||
| plugin header holds another version is refused. | ||
| required: true | ||
| zip: | ||
| description: >- | ||
| The build to upload: the path of a `.zip`, relative to the checkout. A step before this one | ||
| builds it. The action builds nothing and looks for no file on its own. | ||
| required: true | ||
| status: | ||
| description: >- | ||
| The state the version is left in: `draft`, `review` or `published`. Only a published version | ||
| is served to customers. | ||
| required: false | ||
| default: 'published' | ||
| changelog-file: | ||
| description: >- | ||
| A file in the checkout with the changelog entries of this version, one per line, each starting | ||
| with `* `. No version and no date: Herald shows the field as it is. When empty, the version | ||
| keeps the entries Herald read from the changelog.txt or the readme.txt in the ZIP, without the | ||
| header line Herald writes above them. | ||
| required: false | ||
| default: '' | ||
| api-key: | ||
| description: >- | ||
| A Herald API key of scope `ci`, from a secret. That scope can upload ZIPs and create, read and | ||
| update versions, and nothing else. | ||
| required: true | ||
|
|
||
| outputs: | ||
| zip-id: | ||
| description: 'The id of the ZIP record in Herald.' | ||
| value: ${{ steps.publish.outputs.zip-id }} | ||
| sha256: | ||
| description: 'The SHA-256 of the ZIP. Herald computes it for a ZIP it stores. For a ZIP Herald already held, it is the hash of the file.' | ||
| value: ${{ steps.publish.outputs.sha256 }} | ||
| status: | ||
| description: 'The status the version was left in.' | ||
| value: ${{ steps.publish.outputs.status }} | ||
| created: | ||
| description: '`true` when the version was created, `false` when it existed and was updated.' | ||
| value: ${{ steps.publish.outputs.created }} | ||
| versions-url: | ||
| description: "The page of the Herald dashboard that lists the product's versions, newest first." | ||
| value: ${{ steps.publish.outputs.versions-url }} | ||
|
|
||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Publish the ZIP to Herald | ||
| id: publish | ||
| uses: actions/github-script@v9 | ||
| env: | ||
| # github-script's require() resolves against the workspace of the repository being built, | ||
| # not this action's directory, so the path has to be passed in. | ||
| ACTION_PATH: ${{ github.action_path }} | ||
| # Read from process.env rather than interpolated into the script, so an input is data and | ||
| # never part of the program. | ||
| INPUT_HERALD_URL: ${{ inputs.herald-url }} | ||
| INPUT_PRODUCT_SLUG: ${{ inputs.product-slug }} | ||
| INPUT_VERSION: ${{ inputs.version }} | ||
| INPUT_ZIP: ${{ inputs.zip }} | ||
| INPUT_STATUS: ${{ inputs.status }} | ||
| INPUT_CHANGELOG_FILE: ${{ inputs.changelog-file }} | ||
| INPUT_API_KEY: ${{ inputs.api-key }} | ||
| with: | ||
| script: | | ||
| const { runHeraldPublish } = require(`${process.env.ACTION_PATH}/herald-publish.js`) | ||
| await runHeraldPublish({ core, env: process.env }) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.