-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: finalize release version (#57)
* chore: wip change approach * chore: prune unused imports * chore: convert config repos to hash table * chore: implementing sync command * fix: history merging and commits retrieval * feat: complete sync command * ci: release preparation * chore: cleanup * refactor: derive history from git (#58) * ci: bake permissions in executables * refactor: derive history from git
- Loading branch information
1 parent
9afe4c3
commit fae928d
Showing
29 changed files
with
600 additions
and
493 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
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 |
---|---|---|
|
@@ -53,6 +53,17 @@ rules with [deno fmt][deno-fmt], and lint with [deno lint][deno-lint]. We | |
encourage you to [setup your IDE/Editor][deno-env] to automatically apply | ||
formatting. | ||
|
||
## Release | ||
|
||
To release a new version the RC (release coordinator) should: | ||
|
||
1. Create a new release branch | ||
2. Bump up the version in `version.ts` | ||
3. Commit the changes, push the branch, and prepare a PR | ||
4. Merge the PR to main | ||
5. Pull the changes locally, create a new tag with the correct version and push | ||
it | ||
|
||
[deno-install]: https://deno.land/[email protected]/getting_started/installation | ||
[deno-env]: https://deno.land/[email protected]/getting_started/setup_your_environment | ||
[github-prs]: https://github.com/trunklabs/gh-contribution-mate/pulls | ||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/usr/bin/env bash | ||
deno task compile "$@" | ||
deno run --allow-run=deno script/compile.ts "$@" |
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,10 +1,10 @@ | ||
import { join } from 'https://deno.land/[email protected]/path/mod.ts'; | ||
|
||
const [version] = Deno.args; | ||
import { VERSION } from '../version.ts'; | ||
|
||
if (!version) { | ||
if (!VERSION) { | ||
console.error( | ||
`[%cERROR%c] Incorrect version. %cExpected%c format "v*.*.*", %creceived%c "${version}"`, | ||
`[%cERROR%c] Incorrect version. %cExpected%c format "v*.*.*", %creceived%c "${VERSION}"`, | ||
'color: red', | ||
'color: inherit', | ||
'color: green', | ||
|
@@ -79,26 +79,29 @@ for (const { platform, arch } of targets) { | |
continue; | ||
} | ||
|
||
const filename = `gh-contribution-mate_${platform}-${arch}`; | ||
const filename = `gh-contribution-mate_v${VERSION}_${platform}-${arch}`; | ||
|
||
const { success, code } = await Deno.run({ | ||
cmd: [ | ||
'deno', | ||
const cmd = new Deno.Command('deno', { | ||
args: [ | ||
'compile', | ||
'--allow-run=gh,git', | ||
'--allow-read', | ||
'--allow-write', | ||
`--allow-env=${ | ||
platform === Platform.WINDOWS ? 'APPDATA' : 'XDG_CONFIG_HOME,HOME' | ||
}}`, | ||
'-o', | ||
join(outDir, filename), | ||
'--target', | ||
denoSupportedTarget, | ||
'src/main.ts', | ||
], | ||
}).status(); | ||
}); | ||
|
||
if (!success) { | ||
console.error( | ||
`[%cERROR%c] Compilation of "${filename}" failed, status code: ${code}`, | ||
'color: red', | ||
'color: inherit', | ||
); | ||
Deno.exit(code); | ||
const cmdOutput = await cmd.output(); | ||
|
||
if (cmdOutput.code !== 0) { | ||
console.error(new TextDecoder().decode(cmdOutput.stderr)); | ||
Deno.exit(cmdOutput.code); | ||
} | ||
} |
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,47 @@ | ||
import { EOL } from 'std/fs'; | ||
import { basename } from 'std/path'; | ||
import { Checkbox, colors, Command } from 'cliffy'; | ||
import { getConfig, RepoType, setConfig } from '../config.ts'; | ||
import { getAuthors } from '../git.ts'; | ||
|
||
export default new Command() | ||
.description('Add one or more local repositories for syncing.') | ||
.arguments('<...repositories:string>') | ||
.option('-e, --email <email:string>', 'Email to sync', { collect: true }) | ||
.action(async (_, ...repoPaths) => { | ||
const config = await getConfig(); | ||
const mutableConfig = { ...config }; | ||
|
||
for (const repoPath of repoPaths) { | ||
const authors = await getAuthors(repoPath); | ||
|
||
const selectedAuthors: string[] = await Checkbox.prompt({ | ||
message: `Select authors of commits to extract from the "${ | ||
basename(repoPath) | ||
} repository". Use arrow keys for navigation, space to select, and enter to submit.`, | ||
options: authors.map((author) => `${author.name} <${author.email}>`), | ||
}); | ||
|
||
const repo: RepoType = { | ||
dir: repoPath, | ||
authors: authors.filter((author) => | ||
selectedAuthors.includes(`${author.name} <${author.email}>`) | ||
), | ||
}; | ||
|
||
mutableConfig.repos[basename(repoPath)] = repo; | ||
} | ||
|
||
await setConfig(mutableConfig); | ||
|
||
console.log( | ||
'\xa0🎉', | ||
colors.green('You are all set!'), | ||
EOL.LF, | ||
colors.green('ℹ️\xa0'), | ||
colors.green( | ||
'You can run the "sync" command to synchronize your commits now.', | ||
), | ||
colors.green('See more information with the "--help" flag.'), | ||
); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.