Skip to content

Commit

Permalink
Add support for ingest-changes to refer to a project without package.…
Browse files Browse the repository at this point in the history
…json (#3864)

* Tidy reusable release workflow

Signed-off-by: Michael Telatynski <[email protected]>

* Add ability to include upstream changes

Signed-off-by: Michael Telatynski <[email protected]>

* Add ability to upload assets and gpg sign them

Signed-off-by: Michael Telatynski <[email protected]>

* Update relative composite actions

Signed-off-by: Michael Telatynski <[email protected]>

* Wire up validating release tarball signature

Signed-off-by: Michael Telatynski <[email protected]>

* Validate release has expected assets

Signed-off-by: Michael Telatynski <[email protected]>

* Paths

Signed-off-by: Michael Telatynski <[email protected]>

* Use gpg outputs for email instead of scraping it ourselves

Signed-off-by: Michael Telatynski <[email protected]>

* v6

Signed-off-by: Michael Telatynski <[email protected]>

* Extract pre-release and post-merge-master scripts

Signed-off-by: Michael Telatynski <[email protected]>

* Reuse pre-release and post-merge-master scripts in gha

Signed-off-by: Michael Telatynski <[email protected]>

* Cull unused vars

Signed-off-by: Michael Telatynski <[email protected]>

* Revert

Signed-off-by: Michael Telatynski <[email protected]>

* Remove unused variables

Signed-off-by: Michael Telatynski <[email protected]>

* Simplify

Signed-off-by: Michael Telatynski <[email protected]>

* Simplify and fix merge-release-notes script

Signed-off-by: Michael Telatynski <[email protected]>

* Tidy release automation

Signed-off-by: Michael Telatynski <[email protected]>

* Update release.sh

* Move environment

Signed-off-by: Michael Telatynski <[email protected]>

* s/includes/contains/

Signed-off-by: Michael Telatynski <[email protected]>

* Iterate uses syntax

Signed-off-by: Michael Telatynski <[email protected]>

* Fix action-repo calls

Signed-off-by: Michael Telatynski <[email protected]>

* Fix RELEASE_NOTES env

Signed-off-by: Michael Telatynski <[email protected]>

* Fix if check

Signed-off-by: Michael Telatynski <[email protected]>

* Fix gpg tag signing

Signed-off-by: Michael Telatynski <[email protected]>

* Cull stale params

Signed-off-by: Michael Telatynski <[email protected]>

* Fix sign-release-tarball paths being outside the workspace

Signed-off-by: Michael Telatynski <[email protected]>

* Fix gpg validation (of course wget uses `-O` and not `-o`)

Signed-off-by: Michael Telatynski <[email protected]>

* Fix expected asset assertion

Signed-off-by: Michael Telatynski <[email protected]>

* Fix release publish mode

Signed-off-by: Michael Telatynski <[email protected]>

* Add support for ingest-changes to refer to a project without it being in node_modules

Signed-off-by: Michael Telatynski <[email protected]>

---------

Signed-off-by: Michael Telatynski <[email protected]>
  • Loading branch information
t3chguy authored Nov 13, 2023
1 parent d179b8c commit 7de9b23
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,13 @@ jobs:
with:
retries: 3
script: |
const { RELEASE_ID: releaseId, DEPENDENCY } = process.env;
const { RELEASE_ID: releaseId, DEPENDENCY, VERSION } = process.env;
const { owner, repo } = context.repo;
const script = require("./.action-repo/scripts/release/merge-release-notes.js");
const notes = await script({
github,
releaseId,
dependencies: [DEPENDENCY],
dependencies: [DEPENDENCY.replace("$VERSION", VERSION)],
});
core.exportVariable("RELEASE_NOTES", notes);
Expand Down
15 changes: 12 additions & 3 deletions scripts/release/merge-release-notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,18 @@
const fs = require("fs");

async function getRelease(github, dependency) {
const upstreamPackageJson = JSON.parse(fs.readFileSync(`./node_modules/${dependency}/package.json`, "utf8"));
const [owner, repo] = upstreamPackageJson.repository.url.split("/").slice(-2);
const tag = `v${upstreamPackageJson.version}`;
let owner;
let repo;
let tag;
if (dependency.includes("/") && dependency.includes("@")) {
owner = dependency.split("/")[0];
repo = dependency.split("/")[1].split("@")[0];
tag = dependency.split("@")[1];
} else {
const upstreamPackageJson = JSON.parse(fs.readFileSync(`./node_modules/${dependency}/package.json`, "utf8"));
[owner, repo] = upstreamPackageJson.repository.url.split("/").slice(-2);
tag = `v${upstreamPackageJson.version}`;
}

const response = await github.rest.repos.getReleaseByTag({
owner,
Expand Down

0 comments on commit 7de9b23

Please sign in to comment.