diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml new file mode 100644 index 000000000..b2712116d --- /dev/null +++ b/.github/workflows/publish_release.yml @@ -0,0 +1,22 @@ +name: NPM Release +on: + workflow_dispatch: + release: + types: + - published +jobs: + npm_release: + runs-on: ubuntu-latest + steps: + - name: "Checkout code" + uses: actions/checkout@v4 + - name: "Fetch unshallow repo" + run: git fetch --prune --unshallow + - name: Update npm packages to latest version + working-directory: ./npm/@fastly/cli + run: npm install && npm version "${{ github.ref_name }}" --allow-same-version + - name: Publish npm packages + working-directory: ./npm/@fastly + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: for dir in *; do (echo $dir && cd $dir && npm publish); done diff --git a/.github/workflows/tag_release.yml b/.github/workflows/tag_to_draft_release.yml similarity index 82% rename from .github/workflows/tag_release.yml rename to .github/workflows/tag_to_draft_release.yml index 39cc871bb..48ecb4751 100644 --- a/.github/workflows/tag_release.yml +++ b/.github/workflows/tag_to_draft_release.yml @@ -1,4 +1,4 @@ -name: Release +name: Draft Release from Tag on: workflow_dispatch: push: @@ -46,11 +46,3 @@ jobs: GOHOSTOS: ${{ env.GOHOSTOS }} GOHOSTARCH: ${{ env.GOHOSTARCH }} GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} - - name: Update npm packages to latest version - working-directory: ./npm/@fastly/cli - run: npm install && npm version "${{ github.ref_name }}" --allow-same-version - - name: Publish npm packages - working-directory: ./npm/@fastly - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: for dir in *; do (echo $dir && cd $dir && npm publish); done