-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
| 🚥 Resolves ISSUE_ID | | :------------------- | ## 🧰 Changes (still in-progress) separate PR from [#1068](#1068) with a new architecture for github actions that plays nicely with oclif. outstanding work: - [ ] remove all docker build/tagging/release code - [ ] update `semantic-release` workflow to support this new process. here are the assets we'll need to consider every time we tag a release ([link](https://github.com/readmeio/rdme/blob/d01d76fe3c2e4a98b4f5c415be03e589fbe3b56e/.releaserc.yml#L30)): - [ ] command list README (i.e., the one generated by `oclif readme` - [ ] we do **not** need to update `action.yml` on every release anymore - [ ] everything in `dist-gha` (the two JS files ~~and `package.json`~~) - [ ] (do we need an `oclif` manifest in this directory? probably not?) - [ ] we might not actually need to track this duplicated `package.json` — what if we used the [`runs.pre`](https://docs.github.com/en/actions/sharing-automations/creating-actions/metadata-syntax-for-github-actions#runspre) script to generate it? - [ ] package/package-lock.json - [ ] CHANGELOG.md - [ ] `oclif` manifest (this one is interesting... we probably don't need to git track it but it should be included in our npm assets) ## 🧬 QA & Testing Provide as much information as you can on how to test what you've done.
- Loading branch information
1 parent
6f858aa
commit b155c0e
Showing
15 changed files
with
401 additions
and
813 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
coverage/ | ||
dist/ | ||
dist-gha/ | ||
exe/ |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ node_modules/ | |
tmp/ | ||
|
||
# required for building with TS | ||
dist-gha/package.json | ||
src/package.json |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ __tests__/__fixtures__/invalid-json/yikes.json | |
CHANGELOG.md | ||
coverage/ | ||
dist/ | ||
dist-gha/ | ||
exe/ |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#! /usr/bin/env node | ||
// @ts-check | ||
|
||
import fs from 'node:fs'; | ||
import path from 'node:path'; | ||
|
||
const newTarget = './cmds.js'; | ||
|
||
/** | ||
* We need to duplicate the `package.json` file (with a few modifications) from the root of the project to the | ||
* `dist-gha` directory, so that the GitHub Actions-flavored `oclif` configuration can find it. | ||
*/ | ||
function writeGitHubActionsPackageJson() { | ||
const current = JSON.parse( | ||
fs.readFileSync(path.resolve(import.meta.dirname, '../package.json'), { encoding: 'utf-8' }), | ||
); | ||
|
||
current.private = true; | ||
|
||
// set the correct targets for GitHub Actions | ||
current.oclif.commands.target = newTarget; | ||
Object.values(current.oclif.hooks).forEach(hook => { | ||
// eslint-disable-next-line no-param-reassign | ||
hook.target = newTarget; | ||
}); | ||
|
||
// remove properties that are only applicable in a CLI context | ||
delete current.oclif.helpClass; | ||
delete current.oclif.plugins; | ||
|
||
// write the new package.json file | ||
fs.writeFileSync(path.resolve(import.meta.dirname, '../dist-gha/package.json'), JSON.stringify(current, null, 2)); | ||
} | ||
|
||
writeGitHubActionsPackageJson(); |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
Oops, something went wrong.