Merge pull request #58 from htdangkhoa/develop #23
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: Publish to NPM | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- v* | |
jobs: | |
export-google-ads-api-version: | |
uses: ./.github/workflows/export-google-ads-api-version.yml | |
with: | |
environment: production | |
build: | |
name: Build | |
needs: export-google-ads-api-version | |
uses: ./.github/workflows/template.yml | |
with: | |
node-version: 20 | |
google-ads-api-version: ${{ needs.export-google-ads-api-version.outputs.google-ads-api-version }} | |
test: false | |
build: true | |
publish: | |
name: Publish | |
needs: build | |
runs-on: ubuntu-latest | |
environment: production | |
permissions: write-all | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download build artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: build 20 | |
path: build | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: 'https://registry.npmjs.org' | |
- name: Publish | |
run: | | |
npm version ${GITHUB_REF#refs/tags/v} --no-git-tag-version | |
npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
cleanup: | |
name: Cleanup | |
needs: publish | |
uses: ./.github/workflows/cleanup.yml | |
with: | |
environment: production |