Skip to content

Publish to fig autocomplete #88

Publish to fig autocomplete

Publish to fig autocomplete #88

name: Publish to fig autocomplete
on:
workflow_call:
workflow_dispatch:
jobs:
get-cli-version:
runs-on: pub-hk-ubuntu-22.04-small
outputs:
version: ${{ steps.cli-version.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- run: yarn --immutable --network-timeout 1000000
- name: Build Heroku CLI
run: yarn build
- name: Get Heroku Version
id: cli-version
run: echo "version=$(./bin/run version | sed -n 's/.*v\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p')" >> "$GITHUB_OUTPUT"
push-to-fig-autocomplete:
needs: ['get-cli-version']
runs-on: pub-hk-ubuntu-22.04-small
env:
version2: ${{ needs.get-cli-version.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: Install Fig Oclif Plugin
run: cd packages/cli && yarn add @fig/complete-oclif && jq '.oclif.plugins += ["@fig/complete-oclif"]' package.json > temp.json && mv temp.json package.json
- run: yarn --immutable --network-timeout 1000000
- name: Build Heroku CLI
run: yarn build
# - name: Get Heroku Version
# id: cli-version
# run: echo "version=$(./bin/run version | sed -n 's/.*v\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p')" >> "$GITHUB_OUTPUT"
- name: Generate Fig Spec
run: cd packages/cli && ./bin/run generate-fig-spec > spec.ts && echo "${{ env.version2 }}"
- name: Create Fig Autocomplete PR
uses: withfig/push-to-fig-autocomplete-action@v2
with:
token: ${{ secrets.HEROKU_CLI_BOT_TOKEN }}
autocomplete-spec-name: 'heroku'
spec-path: ./packages/cli/spec.ts
integration: oclif
diff-based-versioning: true
new-spec-version: ${{ needs.get-cli-version.outputs.version }}
pr-body: Automated PR for latest Heroku CLI release