From b3aca84f354f97c06db5dcfdb4973c251e25ea72 Mon Sep 17 00:00:00 2001 From: Sam Lijin Date: Fri, 13 Dec 2024 12:18:23 -0800 Subject: [PATCH 01/10] chore: force push npm package --- .github/workflows/release.yml | 306 +++++++++++++++++----------------- 1 file changed, 155 insertions(+), 151 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 46acfa443..50fab679b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,6 +16,8 @@ on: tags: - "test-release/*.*" - "*.*" + branches: + - sam/npm-token-fix concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -25,70 +27,70 @@ permissions: id-token: write jobs: - build-python-release: - uses: ./.github/workflows/build-python-release.reusable.yaml - - build-ruby-release: - uses: ./.github/workflows/build-ruby-release.reusable.yaml - - build-typescript-release: - uses: ./.github/workflows/build-typescript-release.reusable.yaml - - build-vscode-release: - uses: ./.github/workflows/build-vscode-release.reusable.yaml - - # placeholder fan-in step - all-builds: - name: Assert all builds passed - runs-on: ubuntu-latest - needs: - - build-python-release - - build-ruby-release - - build-typescript-release - - build-vscode-release - steps: - - run: echo "::do-nothing::" >/dev/null - - publish-to-pypi: - environment: release - needs: [all-builds] - if: ${{ startsWith(github.ref, 'refs/tags/') }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: "3.8" - - uses: actions/download-artifact@v4 - with: - pattern: wheels-* - path: dist - merge-multiple: true - - # Verify we have the expected number of wheels - - name: Verify wheel count - run: | - set -euo pipefail - ls dist/ - wheel_count=$(ls dist/*.whl 2>/dev/null | wc -l) - if [ "$wheel_count" -lt 7 ]; then - echo "Error: Expected at least 7 wheels, but found $wheel_count" - exit 1 - fi - echo "Found $wheel_count wheels" - - # authz is managed via OIDC configured at https://pypi.org/manage/project/baml-py/settings/publishing/ - # it is pinned to this github actions filename, so renaming this file is not safe!! - - name: Publish package to PyPI - uses: PyO3/maturin-action@v1 - with: - command: upload - args: dist/* + # build-python-release: + # uses: ./.github/workflows/build-python-release.reusable.yaml + + # build-ruby-release: + # uses: ./.github/workflows/build-ruby-release.reusable.yaml + + # build-typescript-release: + # uses: ./.github/workflows/build-typescript-release.reusable.yaml + + # build-vscode-release: + # uses: ./.github/workflows/build-vscode-release.reusable.yaml + + # # placeholder fan-in step + # all-builds: + # name: Assert all builds passed + # runs-on: ubuntu-latest + # needs: + # - build-python-release + # - build-ruby-release + # - build-typescript-release + # - build-vscode-release + # steps: + # - run: echo "::do-nothing::" >/dev/null + + # publish-to-pypi: + # environment: release + # needs: [all-builds] + # if: ${{ startsWith(github.ref, 'refs/tags/') }} + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-python@v5 + # with: + # python-version: "3.8" + # - uses: actions/download-artifact@v4 + # with: + # pattern: wheels-* + # path: dist + # merge-multiple: true + + # # Verify we have the expected number of wheels + # - name: Verify wheel count + # run: | + # set -euo pipefail + # ls dist/ + # wheel_count=$(ls dist/*.whl 2>/dev/null | wc -l) + # if [ "$wheel_count" -lt 7 ]; then + # echo "Error: Expected at least 7 wheels, but found $wheel_count" + # exit 1 + # fi + # echo "Found $wheel_count wheels" + + # # authz is managed via OIDC configured at https://pypi.org/manage/project/baml-py/settings/publishing/ + # # it is pinned to this github actions filename, so renaming this file is not safe!! + # - name: Publish package to PyPI + # uses: PyO3/maturin-action@v1 + # with: + # command: upload + # args: dist/* publish-to-npm: environment: release - needs: [all-builds] - if: ${{ startsWith(github.ref, 'refs/tags/') }} + # needs: [all-builds] + # if: ${{ startsWith(github.ref, 'refs/tags/') }} runs-on: ubuntu-latest env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -117,6 +119,8 @@ jobs: with: pattern: bindings-* path: engine/language_client_typescript/artifacts + run-id: 12318760112 + github-token: ${{ secrets.SAM_GITHUB_PAT }} - name: create npm dirs run: pnpm napi create-npm-dirs @@ -134,93 +138,93 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - publish-to-rubygems: - environment: release - needs: [all-builds] - if: ${{ startsWith(github.ref, 'refs/tags/') }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: rubygems/configure-rubygems-credentials@main - with: - # https://rubygems.org/profile/oidc/api_key_roles/rg_oidc_akr_p6x4xz53qtk948na3bgy - role-to-assume: rg_oidc_akr_p6x4xz53qtk948na3bgy - - - uses: jdx/mise-action@v2 - - - uses: actions/download-artifact@v4 - with: - pattern: gem-* - path: engine/language_client_ruby/pkg/ - merge-multiple: true - - - working-directory: engine/language_client_ruby - run: | - set -euxo pipefail - find pkg - for i in $(ls pkg/*.gem); do - gem push $i - done - - publish-to-github: - environment: release - needs: [all-builds] - if: ${{ startsWith(github.ref, 'refs/tags/') }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Get Changelog - id: latest_release - run: | - echo "::set-output name=changelog::$(awk '/^## \[/{if (p) exit; p=1} p' CHANGELOG.md)" - - - name: Create Release - uses: mikepenz/action-gh-release@v1 #softprops/action-gh-release - with: - body: ${{steps.latest_release.outputs.changelog}} - - publish-to-open-vsx: - environment: release - needs: [all-builds] - runs-on: ubuntu-latest - if: ${{ startsWith(github.ref, 'refs/tags/') || inputs.force_publish_vscode }} - steps: - - uses: actions/checkout@v4 - - uses: jdx/mise-action@v2 - - name: Install Dependencies - run: pnpm install --frozen-lockfile - working-directory: typescript/ - - uses: actions/download-artifact@v4 - with: - name: baml-vscode-vsix - path: typescript/vscode-ext/packages/out/ - - name: Publish to open-vsx - run: | - cd typescript/vscode-ext/packages - pnpm ovsx publish --packagePath ./out/*.vsix - env: - OVSX_PAT: ${{ secrets.OVSX_PAT }} - - publish-to-vscode-marketplace: - environment: release - needs: [all-builds] - runs-on: ubuntu-latest - if: ${{ startsWith(github.ref, 'refs/tags/') || inputs.force_publish_vscode }} - steps: - - uses: actions/checkout@v4 - - uses: jdx/mise-action@v2 - - name: Install Dependencies - run: pnpm install --frozen-lockfile - working-directory: typescript/ - - uses: actions/download-artifact@v4 - with: - name: baml-vscode-vsix - path: typescript/vscode-ext/packages/out/ - - name: Publish to VSCode Marketplace - run: | - cd typescript/vscode-ext/packages - pnpm vsce publish --packagePath ./out/*.vsix - env: - VSCE_PAT: ${{ secrets.VSCODE_PAT }} + # publish-to-rubygems: + # environment: release + # needs: [all-builds] + # if: ${{ startsWith(github.ref, 'refs/tags/') }} + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + + # - uses: rubygems/configure-rubygems-credentials@main + # with: + # # https://rubygems.org/profile/oidc/api_key_roles/rg_oidc_akr_p6x4xz53qtk948na3bgy + # role-to-assume: rg_oidc_akr_p6x4xz53qtk948na3bgy + + # - uses: jdx/mise-action@v2 + + # - uses: actions/download-artifact@v4 + # with: + # pattern: gem-* + # path: engine/language_client_ruby/pkg/ + # merge-multiple: true + + # - working-directory: engine/language_client_ruby + # run: | + # set -euxo pipefail + # find pkg + # for i in $(ls pkg/*.gem); do + # gem push $i + # done + + # publish-to-github: + # environment: release + # needs: [all-builds] + # if: ${{ startsWith(github.ref, 'refs/tags/') }} + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + + # - name: Get Changelog + # id: latest_release + # run: | + # echo "::set-output name=changelog::$(awk '/^## \[/{if (p) exit; p=1} p' CHANGELOG.md)" + + # - name: Create Release + # uses: mikepenz/action-gh-release@v1 #softprops/action-gh-release + # with: + # body: ${{steps.latest_release.outputs.changelog}} + + # publish-to-open-vsx: + # environment: release + # needs: [all-builds] + # runs-on: ubuntu-latest + # if: ${{ startsWith(github.ref, 'refs/tags/') || inputs.force_publish_vscode }} + # steps: + # - uses: actions/checkout@v4 + # - uses: jdx/mise-action@v2 + # - name: Install Dependencies + # run: pnpm install --frozen-lockfile + # working-directory: typescript/ + # - uses: actions/download-artifact@v4 + # with: + # name: baml-vscode-vsix + # path: typescript/vscode-ext/packages/out/ + # - name: Publish to open-vsx + # run: | + # cd typescript/vscode-ext/packages + # pnpm ovsx publish --packagePath ./out/*.vsix + # env: + # OVSX_PAT: ${{ secrets.OVSX_PAT }} + + # publish-to-vscode-marketplace: + # environment: release + # needs: [all-builds] + # runs-on: ubuntu-latest + # if: ${{ startsWith(github.ref, 'refs/tags/') || inputs.force_publish_vscode }} + # steps: + # - uses: actions/checkout@v4 + # - uses: jdx/mise-action@v2 + # - name: Install Dependencies + # run: pnpm install --frozen-lockfile + # working-directory: typescript/ + # - uses: actions/download-artifact@v4 + # with: + # name: baml-vscode-vsix + # path: typescript/vscode-ext/packages/out/ + # - name: Publish to VSCode Marketplace + # run: | + # cd typescript/vscode-ext/packages + # pnpm vsce publish --packagePath ./out/*.vsix + # env: + # VSCE_PAT: ${{ secrets.VSCODE_PAT }} From 0fba3a31b88dd6812e08e55bb65fa25b4d1eb531 Mon Sep 17 00:00:00 2001 From: Sam Lijin Date: Fri, 13 Dec 2024 12:24:12 -0800 Subject: [PATCH 02/10] publish via git --- engine/language_client_typescript/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/language_client_typescript/package.json b/engine/language_client_typescript/package.json index ce111573d..20b3d4af7 100644 --- a/engine/language_client_typescript/package.json +++ b/engine/language_client_typescript/package.json @@ -4,7 +4,7 @@ "description": "BAML typescript bindings (package.json)", "repository": { "type": "git", - "url": "https://github.com/BoundaryML/baml.git", + "url": "git+https://github.com/BoundaryML/baml.git", "directory": "engine/language_client_typescript" }, "license": "MIT", From 53656cb338425bf4f13835141e5de7de2f2e7de2 Mon Sep 17 00:00:00 2001 From: Sam Lijin Date: Fri, 13 Dec 2024 12:30:19 -0800 Subject: [PATCH 03/10] adduser --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 50fab679b..6f7656480 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -132,6 +132,7 @@ jobs: - name: Publish run: | + npm adduser npm publish --access public working-directory: engine/language_client_typescript env: From 9f254568d3b8bd49dbbef79ef2ea4ed02544e71a Mon Sep 17 00:00:00 2001 From: Sam Lijin Date: Fri, 13 Dec 2024 12:33:29 -0800 Subject: [PATCH 04/10] restore registry url --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6f7656480..9e1df34d4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -110,6 +110,8 @@ jobs: node-version: 20 cache: pnpm cache-dependency-path: engine/language_client_typescript/pnpm-lock.yaml + registry-url: "https://registry.npmjs.org" + - name: Install dependencies run: pnpm install From 5f5bdcf891f9267ce3f957a4048e3f338e7bcc12 Mon Sep 17 00:00:00 2001 From: Sam Lijin Date: Fri, 13 Dec 2024 12:36:05 -0800 Subject: [PATCH 05/10] go again --- .github/workflows/release.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9e1df34d4..b44103298 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -92,8 +92,6 @@ jobs: # needs: [all-builds] # if: ${{ startsWith(github.ref, 'refs/tags/') }} runs-on: ubuntu-latest - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} steps: - uses: actions/checkout@v4 @@ -110,8 +108,12 @@ jobs: node-version: 20 cache: pnpm cache-dependency-path: engine/language_client_typescript/pnpm-lock.yaml + # This is load-bearing: it writes NPM_TOKEN to .npmrc, which is what + # npm publish relies on. + # See https://github.com/npm/cli/issues/6184#issuecomment-1544496444 registry-url: "https://registry.npmjs.org" - + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Install dependencies run: pnpm install @@ -134,12 +136,8 @@ jobs: - name: Publish run: | - npm adduser npm publish --access public working-directory: engine/language_client_typescript - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # publish-to-rubygems: # environment: release From 32266aae8355aa60d2be9024955c7499483ee88c Mon Sep 17 00:00:00 2001 From: Sam Lijin Date: Fri, 13 Dec 2024 12:37:38 -0800 Subject: [PATCH 06/10] comments --- .github/workflows/release.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b44103298..255f3eddc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -108,7 +108,7 @@ jobs: node-version: 20 cache: pnpm cache-dependency-path: engine/language_client_typescript/pnpm-lock.yaml - # This is load-bearing: it writes NPM_TOKEN to .npmrc, which is what + # This is load-bearing: it writes NODE_AUTH_TOKEN to .npmrc, which is what # npm publish relies on. # See https://github.com/npm/cli/issues/6184#issuecomment-1544496444 registry-url: "https://registry.npmjs.org" @@ -135,8 +135,9 @@ jobs: working-directory: engine/language_client_typescript - name: Publish - run: | - npm publish --access public + # This reads the credential from .npmrc, which is written by the setup-node step. + # It does not use the NODE_AUTH_TOKEN environment variable. + run: npm publish --access public working-directory: engine/language_client_typescript # publish-to-rubygems: From 961d18bff522dd5b88e74a664b614d4767fde9be Mon Sep 17 00:00:00 2001 From: Sam Lijin Date: Fri, 13 Dec 2024 12:38:28 -0800 Subject: [PATCH 07/10] test repro --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 255f3eddc..27991b546 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -111,7 +111,7 @@ jobs: # This is load-bearing: it writes NODE_AUTH_TOKEN to .npmrc, which is what # npm publish relies on. # See https://github.com/npm/cli/issues/6184#issuecomment-1544496444 - registry-url: "https://registry.npmjs.org" + # registry-url: "https://registry.npmjs.org" env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From cdaee2aef9d8d88f925ea273d853044c224090bf Mon Sep 17 00:00:00 2001 From: Sam Lijin Date: Fri, 13 Dec 2024 12:40:56 -0800 Subject: [PATCH 08/10] restore --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 27991b546..255f3eddc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -111,7 +111,7 @@ jobs: # This is load-bearing: it writes NODE_AUTH_TOKEN to .npmrc, which is what # npm publish relies on. # See https://github.com/npm/cli/issues/6184#issuecomment-1544496444 - # registry-url: "https://registry.npmjs.org" + registry-url: "https://registry.npmjs.org" env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From 033abba65f272dae602d447c6914f3e0cc76f094 Mon Sep 17 00:00:00 2001 From: Sam Lijin Date: Fri, 13 Dec 2024 12:41:30 -0800 Subject: [PATCH 09/10] restore the release workflow --- .github/workflows/release.yml | 302 +++++++++++++++++----------------- 1 file changed, 149 insertions(+), 153 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 255f3eddc..9fee7b48d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,8 +16,6 @@ on: tags: - "test-release/*.*" - "*.*" - branches: - - sam/npm-token-fix concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -27,65 +25,65 @@ permissions: id-token: write jobs: - # build-python-release: - # uses: ./.github/workflows/build-python-release.reusable.yaml - - # build-ruby-release: - # uses: ./.github/workflows/build-ruby-release.reusable.yaml - - # build-typescript-release: - # uses: ./.github/workflows/build-typescript-release.reusable.yaml - - # build-vscode-release: - # uses: ./.github/workflows/build-vscode-release.reusable.yaml - - # # placeholder fan-in step - # all-builds: - # name: Assert all builds passed - # runs-on: ubuntu-latest - # needs: - # - build-python-release - # - build-ruby-release - # - build-typescript-release - # - build-vscode-release - # steps: - # - run: echo "::do-nothing::" >/dev/null - - # publish-to-pypi: - # environment: release - # needs: [all-builds] - # if: ${{ startsWith(github.ref, 'refs/tags/') }} - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # - uses: actions/setup-python@v5 - # with: - # python-version: "3.8" - # - uses: actions/download-artifact@v4 - # with: - # pattern: wheels-* - # path: dist - # merge-multiple: true - - # # Verify we have the expected number of wheels - # - name: Verify wheel count - # run: | - # set -euo pipefail - # ls dist/ - # wheel_count=$(ls dist/*.whl 2>/dev/null | wc -l) - # if [ "$wheel_count" -lt 7 ]; then - # echo "Error: Expected at least 7 wheels, but found $wheel_count" - # exit 1 - # fi - # echo "Found $wheel_count wheels" - - # # authz is managed via OIDC configured at https://pypi.org/manage/project/baml-py/settings/publishing/ - # # it is pinned to this github actions filename, so renaming this file is not safe!! - # - name: Publish package to PyPI - # uses: PyO3/maturin-action@v1 - # with: - # command: upload - # args: dist/* + build-python-release: + uses: ./.github/workflows/build-python-release.reusable.yaml + + build-ruby-release: + uses: ./.github/workflows/build-ruby-release.reusable.yaml + + build-typescript-release: + uses: ./.github/workflows/build-typescript-release.reusable.yaml + + build-vscode-release: + uses: ./.github/workflows/build-vscode-release.reusable.yaml + + # placeholder fan-in step + all-builds: + name: Assert all builds passed + runs-on: ubuntu-latest + needs: + - build-python-release + - build-ruby-release + - build-typescript-release + - build-vscode-release + steps: + - run: echo "::do-nothing::" >/dev/null + + publish-to-pypi: + environment: release + needs: [all-builds] + if: ${{ startsWith(github.ref, 'refs/tags/') }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.8" + - uses: actions/download-artifact@v4 + with: + pattern: wheels-* + path: dist + merge-multiple: true + + # Verify we have the expected number of wheels + - name: Verify wheel count + run: | + set -euo pipefail + ls dist/ + wheel_count=$(ls dist/*.whl 2>/dev/null | wc -l) + if [ "$wheel_count" -lt 7 ]; then + echo "Error: Expected at least 7 wheels, but found $wheel_count" + exit 1 + fi + echo "Found $wheel_count wheels" + + # authz is managed via OIDC configured at https://pypi.org/manage/project/baml-py/settings/publishing/ + # it is pinned to this github actions filename, so renaming this file is not safe!! + - name: Publish package to PyPI + uses: PyO3/maturin-action@v1 + with: + command: upload + args: dist/* publish-to-npm: environment: release @@ -123,8 +121,6 @@ jobs: with: pattern: bindings-* path: engine/language_client_typescript/artifacts - run-id: 12318760112 - github-token: ${{ secrets.SAM_GITHUB_PAT }} - name: create npm dirs run: pnpm napi create-npm-dirs @@ -140,93 +136,93 @@ jobs: run: npm publish --access public working-directory: engine/language_client_typescript - # publish-to-rubygems: - # environment: release - # needs: [all-builds] - # if: ${{ startsWith(github.ref, 'refs/tags/') }} - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - - # - uses: rubygems/configure-rubygems-credentials@main - # with: - # # https://rubygems.org/profile/oidc/api_key_roles/rg_oidc_akr_p6x4xz53qtk948na3bgy - # role-to-assume: rg_oidc_akr_p6x4xz53qtk948na3bgy - - # - uses: jdx/mise-action@v2 - - # - uses: actions/download-artifact@v4 - # with: - # pattern: gem-* - # path: engine/language_client_ruby/pkg/ - # merge-multiple: true - - # - working-directory: engine/language_client_ruby - # run: | - # set -euxo pipefail - # find pkg - # for i in $(ls pkg/*.gem); do - # gem push $i - # done - - # publish-to-github: - # environment: release - # needs: [all-builds] - # if: ${{ startsWith(github.ref, 'refs/tags/') }} - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - - # - name: Get Changelog - # id: latest_release - # run: | - # echo "::set-output name=changelog::$(awk '/^## \[/{if (p) exit; p=1} p' CHANGELOG.md)" - - # - name: Create Release - # uses: mikepenz/action-gh-release@v1 #softprops/action-gh-release - # with: - # body: ${{steps.latest_release.outputs.changelog}} - - # publish-to-open-vsx: - # environment: release - # needs: [all-builds] - # runs-on: ubuntu-latest - # if: ${{ startsWith(github.ref, 'refs/tags/') || inputs.force_publish_vscode }} - # steps: - # - uses: actions/checkout@v4 - # - uses: jdx/mise-action@v2 - # - name: Install Dependencies - # run: pnpm install --frozen-lockfile - # working-directory: typescript/ - # - uses: actions/download-artifact@v4 - # with: - # name: baml-vscode-vsix - # path: typescript/vscode-ext/packages/out/ - # - name: Publish to open-vsx - # run: | - # cd typescript/vscode-ext/packages - # pnpm ovsx publish --packagePath ./out/*.vsix - # env: - # OVSX_PAT: ${{ secrets.OVSX_PAT }} - - # publish-to-vscode-marketplace: - # environment: release - # needs: [all-builds] - # runs-on: ubuntu-latest - # if: ${{ startsWith(github.ref, 'refs/tags/') || inputs.force_publish_vscode }} - # steps: - # - uses: actions/checkout@v4 - # - uses: jdx/mise-action@v2 - # - name: Install Dependencies - # run: pnpm install --frozen-lockfile - # working-directory: typescript/ - # - uses: actions/download-artifact@v4 - # with: - # name: baml-vscode-vsix - # path: typescript/vscode-ext/packages/out/ - # - name: Publish to VSCode Marketplace - # run: | - # cd typescript/vscode-ext/packages - # pnpm vsce publish --packagePath ./out/*.vsix - # env: - # VSCE_PAT: ${{ secrets.VSCODE_PAT }} + publish-to-rubygems: + environment: release + needs: [all-builds] + if: ${{ startsWith(github.ref, 'refs/tags/') }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: rubygems/configure-rubygems-credentials@main + with: + # https://rubygems.org/profile/oidc/api_key_roles/rg_oidc_akr_p6x4xz53qtk948na3bgy + role-to-assume: rg_oidc_akr_p6x4xz53qtk948na3bgy + + - uses: jdx/mise-action@v2 + + - uses: actions/download-artifact@v4 + with: + pattern: gem-* + path: engine/language_client_ruby/pkg/ + merge-multiple: true + + - working-directory: engine/language_client_ruby + run: | + set -euxo pipefail + find pkg + for i in $(ls pkg/*.gem); do + gem push $i + done + + publish-to-github: + environment: release + needs: [all-builds] + if: ${{ startsWith(github.ref, 'refs/tags/') }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Get Changelog + id: latest_release + run: | + echo "::set-output name=changelog::$(awk '/^## \[/{if (p) exit; p=1} p' CHANGELOG.md)" + + - name: Create Release + uses: mikepenz/action-gh-release@v1 #softprops/action-gh-release + with: + body: ${{steps.latest_release.outputs.changelog}} + + publish-to-open-vsx: + environment: release + needs: [all-builds] + runs-on: ubuntu-latest + if: ${{ startsWith(github.ref, 'refs/tags/') || inputs.force_publish_vscode }} + steps: + - uses: actions/checkout@v4 + - uses: jdx/mise-action@v2 + - name: Install Dependencies + run: pnpm install --frozen-lockfile + working-directory: typescript/ + - uses: actions/download-artifact@v4 + with: + name: baml-vscode-vsix + path: typescript/vscode-ext/packages/out/ + - name: Publish to open-vsx + run: | + cd typescript/vscode-ext/packages + pnpm ovsx publish --packagePath ./out/*.vsix + env: + OVSX_PAT: ${{ secrets.OVSX_PAT }} + + publish-to-vscode-marketplace: + environment: release + needs: [all-builds] + runs-on: ubuntu-latest + if: ${{ startsWith(github.ref, 'refs/tags/') || inputs.force_publish_vscode }} + steps: + - uses: actions/checkout@v4 + - uses: jdx/mise-action@v2 + - name: Install Dependencies + run: pnpm install --frozen-lockfile + working-directory: typescript/ + - uses: actions/download-artifact@v4 + with: + name: baml-vscode-vsix + path: typescript/vscode-ext/packages/out/ + - name: Publish to VSCode Marketplace + run: | + cd typescript/vscode-ext/packages + pnpm vsce publish --packagePath ./out/*.vsix + env: + VSCE_PAT: ${{ secrets.VSCODE_PAT }} From 0903efcf9943c4b882c6f72d8fe115581e04dbb0 Mon Sep 17 00:00:00 2001 From: Sam Lijin Date: Tue, 31 Dec 2024 15:56:05 -0800 Subject: [PATCH 10/10] fix --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9fee7b48d..e6f9c76fa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -87,8 +87,8 @@ jobs: publish-to-npm: environment: release - # needs: [all-builds] - # if: ${{ startsWith(github.ref, 'refs/tags/') }} + needs: [all-builds] + if: ${{ startsWith(github.ref, 'refs/tags/') }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4