Release #54
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
name: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
prerelease: | |
description: "Prerelease" | |
required: true | |
default: false | |
type: boolean | |
draft: | |
description: "Draft" | |
required: true | |
default: false | |
type: boolean | |
version-increment-type: | |
description: 'Which part of the version to increment:' | |
required: true | |
type: choice | |
options: | |
- major | |
- minor | |
- patch | |
default: 'patch' | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.AUTOMATION_USER_TOKEN }} | |
fetch-depth: 0 | |
- uses: DevCycleHQ/release-action/prepare-release@main | |
id: prepare-release | |
with: | |
github-token: ${{ secrets.AUTOMATION_USER_TOKEN }} | |
prerelease: ${{ github.event.inputs.prerelease }} | |
draft: ${{ github.event.inputs.draft }} | |
version-increment-type: ${{ github.event.inputs.version-increment-type }} | |
- name: Yarn Install | |
run: yarn install | |
- name: Update version in code | |
run: | | |
yarn version --${{ github.event.inputs.version-increment-type }} --no-git-tag-version | |
- name: Update Changelog | |
run: echo "${{ steps.prepare-release.outputs.changelog }}" > CHANGELOG.md | |
- name: Commit version change | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "DevCycle Automation" | |
git add ./package.json ./CHANGELOG.md | |
git commit -m "Release ${{ steps.prepare-release.outputs.next-release-tag }}" | |
- name: Fill in Rudderstack Key | |
run: | | |
touch src/analytics.ts | |
echo "export const RUDDERSTACK_KEY = '${{ secrets.RUDDERSTACK_KEY }}'" >> src/analytics.ts | |
- name: Package VSCode Extension | |
run: yarn run package | |
- name: Publish VSCode Extension | |
run: | | |
yarn run publish -p ${{ secrets.VSCODE_MARKETPLACE_TOKEN }} | |
- name: Push version change | |
run: | | |
git push origin HEAD:main | |
if: inputs.draft != true | |
- uses: DevCycleHQ/release-action/create-release@main | |
id: create-release | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ steps.prepare-release.outputs.next-release-tag }} | |
target: main | |
prerelease: ${{ github.event.inputs.prerelease }} | |
draft: ${{ github.event.inputs.draft }} | |
changelog: ${{ steps.prepare-release.outputs.changelog }} | |
- name: Display link to release | |
run: | | |
echo "::notice title=Release ID::${{ steps.create-release.outputs.release-id }}" | |
echo "::notice title=Release URL::${{ steps.create-release.outputs.release-url }}" | |
- name: Update Docs | |
uses: ./.github/actions/updateDocs | |
with: | |
latest_tag: ${{ steps.prepare-release.outputs.next-release-tag }} | |
access_token: ${{ secrets.AUTOMATION_USER_TOKEN }} |