Manual Release #12
Workflow file for this run
This file contains hidden or 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: Manual Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version_bump: | |
| description: 'Select version bump type' | |
| required: true | |
| default: 'patch' | |
| type: choice | |
| options: | |
| - patch | |
| - minor | |
| - major | |
| permissions: | |
| contents: write | |
| jobs: | |
| # Bumps the version, tags it, and creates the baseline GitHub Release | |
| create-release: | |
| name: Cut Release Tag | |
| runs-on: ubuntu-latest | |
| outputs: | |
| tag: ${{ steps.version.outputs.tag }} | |
| steps: | |
| # generate a short-lived token from the CI app | |
| - name: Generate GitHub App Token | |
| id: generate-token | |
| uses: actions/create-github-app-token@v1 | |
| with: | |
| app-id: ${{ secrets.APP_ID }} | |
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| # pass that token to checkout to authorize pushes with protection rule bypass | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ steps.generate-token.outputs.token }} | |
| - name: Configure Git User | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| - name: Bump Version & Tag | |
| id: version | |
| working-directory: vscode-extension | |
| run: | | |
| git checkout ${{ github.ref_name }} | |
| NEW_VERSION=$(npm version ${{ inputs.version_bump }} --no-git-tag-version) | |
| echo "tag=$NEW_VERSION" >> $GITHUB_OUTPUT | |
| git add package.json package-lock.json | |
| git commit -m "chore: release $NEW_VERSION" | |
| git tag $NEW_VERSION | |
| - name: Push commit and tag to main | |
| run: | | |
| git push origin ${{ github.ref_name }} | |
| git push origin ${{ steps.version.outputs.tag }} | |
| - name: Create Base GitHub Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| # Create an empty release container marked as latest | |
| gh release create ${{ steps.version.outputs.tag }} \ | |
| --title "${{ steps.version.outputs.tag }}" \ | |
| --generate-notes \ | |
| --latest | |
| # Builds and publishes VSCode extension to latest release and marketplace | |
| publish-vs: | |
| name: Build & Publish VS Code Extension | |
| needs: create-release | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: vscode-extension | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ needs.create-release.outputs.tag }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: vscode-extension/package-lock.json | |
| - name: Install Dependencies | |
| run: npm ci | |
| - name: Package Extension | |
| run: npx vsce package --out out/vscode-extension.vsix | |
| - name: Upload VSIX to Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ needs.create-release.outputs.tag }} | |
| files: vscode-extension/out/vscode-extension.vsix | |
| - name: Publish to Marketplace | |
| run: npx @vscode/vsce publish --packagePath out/vscode-extension.vsix --pat ${{ secrets.AZURE_PAT }} | |
| # Builds and uploads OC plugin to latest release | |
| publish-oc: | |
| name: Build & Upload OpenCode Plugin | |
| needs: create-release | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: opencode-plugin | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ needs.create-release.outputs.tag }} | |
| - uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: latest | |
| - run: bun install | |
| - run: bun run build | |
| - name: Upload OpenCode Asset to Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ needs.create-release.outputs.tag }} | |
| files: opencode-plugin/dist/tracybot-oc.js | |