-
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.
Merge pull request #160 from dkershner6/DAK/majorReleaseTag
chore: Major release tag workflow
- Loading branch information
Showing
5 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". | ||
|
||
name: Update Main Version Tag | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
target: | ||
description: The target tag to update the main tag to | ||
required: true | ||
main_version: | ||
type: choice | ||
description: The main version to update | ||
options: | ||
- v2 | ||
jobs: | ||
tag: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Git config | ||
run: git config user.name github-actions && git config user.email [email protected] | ||
- name: Tag New Target | ||
run: git tag -f ${{ github.event.inputs.major_version }} ${{ github.event.inputs.target }} | ||
- name: Push Tag | ||
run: git push origin ${{ github.event.inputs.major_version }} --force |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,3 +1,4 @@ | ||
import { JobPermission } from "projen/lib/github/workflows-model"; | ||
import { NodePackageManager } from "projen/lib/javascript"; | ||
import { | ||
GitHubActionTypeScriptProject, | ||
|
@@ -55,4 +56,53 @@ const project = new GitHubActionTypeScriptProject({ | |
}, | ||
}); | ||
|
||
const mainVersionTagWorkflow = project.github?.addWorkflow( | ||
"Update Main Version Tag", | ||
); | ||
if (mainVersionTagWorkflow) { | ||
mainVersionTagWorkflow.on({ | ||
workflowDispatch: { | ||
inputs: { | ||
target: { | ||
description: "The target tag to update the main tag to", | ||
required: true, | ||
}, | ||
mainVersion: { | ||
type: "choice", | ||
description: "The main version to update", | ||
options: ["v2"], | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
||
mainVersionTagWorkflow.addJob("tag", { | ||
runsOn: ["ubuntu-latest"], | ||
permissions: { | ||
contents: JobPermission.READ, | ||
}, | ||
steps: [ | ||
{ | ||
name: "Checkout", | ||
uses: "actions/checkout@v2", | ||
with: { | ||
"fetch-depth": 0, | ||
}, | ||
}, | ||
{ | ||
name: "Git config", | ||
run: "git config user.name github-actions && git config user.email [email protected]", | ||
}, | ||
{ | ||
name: "Tag New Target", | ||
run: "git tag -f ${{ github.event.inputs.major_version }} ${{ github.event.inputs.target }}", | ||
}, | ||
{ | ||
name: "Push Tag", | ||
run: "git push origin ${{ github.event.inputs.major_version }} --force", | ||
}, | ||
], | ||
}); | ||
} | ||
|
||
project.synth(); |