From 58b90156bbd1cb905c1e2b86c477426268354367 Mon Sep 17 00:00:00 2001 From: Unknower Date: Fri, 18 Oct 2024 05:13:25 -0400 Subject: [PATCH] add build action for setting latest --- .github/workflows/build-deploy.yml | 45 ++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/build-deploy.yml diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml new file mode 100644 index 0000000..6b34fc5 --- /dev/null +++ b/.github/workflows/build-deploy.yml @@ -0,0 +1,45 @@ +on: + push: + branches: + - sdk7 + pull_request: + release: + types: + - created + +name: Publish NPM package +jobs: + install: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js 16.x + uses: actions/setup-node@v2 + with: + node-version: 16.x + - name: install + run: npm install + - name: build + run: npm run build + - name: Publish + uses: menduz/oddish-action@master + with: + # cwd: ./dist + access: public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + tag_latest: + runs-on: ubuntu-latest + needs: install + if: github.event_name == 'release' + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Tag latest branch + run: | + git fetch --all + git checkout sdk7 + TAG_NAME="latest" + git tag -f $TAG_NAME + git push origin -f $TAG_NAME