-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Joli Lui
committed
Jul 13, 2023
1 parent
70e7bcc
commit dea691c
Showing
5 changed files
with
101 additions
and
74 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: GitHub release and Publish to NPM | ||
description: Create a GitHub release and publish to NPM | ||
|
||
inputs: | ||
github-token: | ||
required: true | ||
description: 'The GitHub token to use for authentication' | ||
release-tag: | ||
required: true | ||
description: 'The tag to use for the release' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
# - name: Create GitHub Release | ||
# uses: DevCycleHQ/release-action/gh-release@main | ||
# with: | ||
# draft: true | ||
# prerelease: true | ||
# github-token: ${{ inputs.github-token }} | ||
|
||
# Replace with DevCycleHQ/release-action/gh-release@main when it's ready | ||
- name: Create GitHub Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
name: "${{ inputs.release-tag }}" | ||
tag: "${{ inputs.release-tag }}" | ||
generateReleaseNotes: "true" | ||
makeLatest: "true" | ||
token: ${{ inputs.github-token }} | ||
|
||
- name: Publish to NPM | ||
shell: bash | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_ACCESS_TOKEN }} | ||
run: npm publish --access public |
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,49 @@ | ||
name: Update Doc | ||
|
||
description: 'Update the CLI version in devcycle-docs' | ||
|
||
inputs: | ||
latest_tag: | ||
required: true | ||
description: 'The latest tag from the workflow that uses this action' | ||
access_token: | ||
required: true | ||
description: 'The access token to use for authentication' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: DevCycleHQ/devcycle-docs | ||
path: devcycle-docs | ||
# need to get/update access token | ||
token: ${{ inputs.access_token }} | ||
fetch-depth: 0 | ||
|
||
- name: Set branch name | ||
shell: bash | ||
working-directory: devcycle-docs | ||
run: echo "BRANCH_NAME=update-cli-version-to-${{ inputs.latest_tag }}" >> $GITHUB_ENV | ||
|
||
- name: Update CLI version in docs repo | ||
shell: bash | ||
working-directory: devcycle-docs | ||
run: | | ||
git checkout -b "$BRANCH_NAME" | ||
sed -i "s/const DVC_CLI_VERSION = .*/const DVC_CLI_VERSION = '${{ inputs.latest_tag }}' \/\/ auto updated by dvc cli release workflow/" docusaurus.config.js | ||
git add docusaurus.config.js | ||
git commit -m "Update CLI version to ${{ inputs.latest_tag }}" | ||
- name: Push code to docs repo | ||
shell: bash | ||
working-directory: devcycle-docs | ||
run: git push --set-upstream origin "$BRANCH_NAME" | ||
|
||
- name: Create PR | ||
shell: bash | ||
working-directory: devcycle-docs | ||
env: | ||
GH_TOKEN: ${{ inputs.access_token }} | ||
run: gh pr create --repo DevCycleHQ/devcycle-docs --base main --head "$BRANCH_NAME" --title "Update CLI version to $LATEST_TAG" --body "This PR was automatically created by the DevCycle CLI release workflow." |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.