From 5db7ce730e4b89f0fae1138343266524758b7897 Mon Sep 17 00:00:00 2001 From: ben Date: Thu, 23 Dec 2021 23:57:32 +0200 Subject: [PATCH] added beta publish workflow --- .github/workflows/publish-beta.yml | 44 +++++++++++++++++++ .../{publish.yml => publish-master.yml} | 2 - 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish-beta.yml rename .github/workflows/{publish.yml => publish-master.yml} (98%) diff --git a/.github/workflows/publish-beta.yml b/.github/workflows/publish-beta.yml new file mode 100644 index 0000000..6fd8950 --- /dev/null +++ b/.github/workflows/publish-beta.yml @@ -0,0 +1,44 @@ +name: publish-and-tag +env: + CI: true +on: + push: + branches: + - beta +jobs: + publish-to-npm: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v2 + - name: setup Node + uses: actions/setup-node@v2 + with: + node-version: 14.x + registry-url: 'https://registry.npmjs.org' + - name: install + run: npm install + - name: test + run: npm test + # Publish to npm if this version is not published + - name: publish + run: npm run publish:beta + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} + create-tag: + runs-on: ubuntu-latest + needs: publish-to-npm + steps: + - name: checkout + uses: actions/checkout@v2 + # Push tag to GitHub if package.json version's tag is not tagged + - name: package-version + run: node -p -e '`PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV + - name: package-version-to-git-tag + uses: pkgdeps/git-tag-action@v2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + github_repo: ${{ github.repository }} + version: ${{ env.PACKAGE_VERSION }} + git_commit_sha: ${{ github.sha }} + git_tag_prefix: "v" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish-master.yml similarity index 98% rename from .github/workflows/publish.yml rename to .github/workflows/publish-master.yml index a8d3632..fa84185 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish-master.yml @@ -5,8 +5,6 @@ on: push: branches: - master - tags: - - "!*" jobs: publish-to-npm: runs-on: ubuntu-latest