diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index d5f9c73..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Build - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - name: Test and Build - steps: - - uses: actions/checkout@v2 - - name: Use Node.js 18.x - uses: actions/setup-node@v1 - with: - node-version: 18.x - - name: install, lint, test, build - run: | - DEBUG=true yarn install --frozen-lockfile - yarn run lint - yarn test - yarn build - - publish: - name: Publish - runs-on: ubuntu-latest - needs: [test] - if: github.ref == 'refs/heads/main' - steps: - - uses: actions/checkout@v2 - - name: Use Node.js 18.x - uses: actions/setup-node@v1 - with: - node-version: 18.x - - name: install - run: yarn install --frozen-lockfile - - - 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" - - - uses: JS-DevTools/npm-publish@v1 - with: - token: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/pull_requests.yml b/.github/workflows/pull_requests.yml new file mode 100644 index 0000000..0c5cd44 --- /dev/null +++ b/.github/workflows/pull_requests.yml @@ -0,0 +1,20 @@ +name: pull_requests + +on: [pull_request] + +jobs: + test: + runs-on: ubuntu-latest + name: Test and Build + steps: + - uses: actions/checkout@v2 + - name: Use Node.js 18.x + uses: actions/setup-node@v1 + with: + node-version: 18.x + - name: install, lint, test, build + run: | + DEBUG=true yarn install --frozen-lockfile + yarn run lint + yarn test + yarn build \ No newline at end of file diff --git a/.github/workflows/release_tags.yml b/.github/workflows/release_tags.yml new file mode 100644 index 0000000..fb96dda --- /dev/null +++ b/.github/workflows/release_tags.yml @@ -0,0 +1,42 @@ +name: release_tags + +on: + push: + tags: + - 'v*.*.*' + +jobs: + test: + runs-on: ubuntu-latest + name: Test and Build + steps: + - uses: actions/checkout@v3 + - name: Use Node.js 18.x + uses: actions/setup-node@v3 + with: + node-version: 18.x + - name: install, lint, test, build + run: | + DEBUG=true yarn install --frozen-lockfile + yarn run lint + yarn test + yarn build + + publish: + name: Publish + runs-on: ubuntu-latest + needs: [test] + steps: + - uses: actions/checkout@v3 + - name: Use Node.js 18.x + uses: actions/setup-node@v3 + with: + node-version: 18.x + - name: install + run: yarn install --frozen-lockfile + + - name: git-tag-name + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + + - name: git-tag-to-package-version + run: npm version ${{ env.RELEASE_VERSION }} --no-git-tag-version