release_prep #3
Workflow file for this run
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_prep | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version to released.' | |
required: true | |
default: '0.0.0' | |
language-server-version: | |
description: 'Version of language server for release to consume. In the format v0.0.0' | |
required: false | |
jobs: | |
release_prep: | |
name: "Release Prep" | |
runs-on: "ubuntu-latest" | |
env: | |
NODE_VERSION: "18" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
with: | |
clean: true | |
fetch-depth: 0 | |
- name: Node ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: "Update Version" | |
run: | | |
cat <<< $(jq '.version="${{ github.event.inputs.version }}"' package.json) > package.json | |
- name: "Update Language Server Version" | |
if: "${{ github.event.inputs.language-server-version != '' }}" | |
run: | | |
cat <<< $(jq '.editorComponents.editorServices.release="${{ github.event.inputs.language-server-version}}"' package.json) > package.json | |
- name: "Generate package-lock.json" | |
run: | | |
npm install | |
npm update --package-lock-only | |
- name: "Generate changelog" | |
run: | | |
export GH_HOST=github.com | |
gh extension install chelnak/gh-changelog | |
gh changelog new --next-version v${{ github.event.inputs.version }} | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: "Commit changes" | |
run: | | |
git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com" | |
git config --local user.name "GitHub Actions" | |
git add . | |
git commit -m "Release prep v${{ github.event.inputs.version }}" | |
- name: "Create pull request" | |
uses: "peter-evans/create-pull-request@v5" | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "Release prep v${{ github.event.inputs.version }}" | |
branch: "release-prep" | |
delete-branch: true | |
title: "Release prep v${{ github.event.inputs.version }}" | |
base: "main" | |
body: | | |
Automated release-prep from commit ${{ github.sha }}. | |
labels: "maintenance" |