From 4ffe069d61ee43e1c5b85e9b6f1c0fce6c434120 Mon Sep 17 00:00:00 2001 From: Jonathan Green Date: Mon, 16 Oct 2023 10:42:56 -0300 Subject: [PATCH] Setup admin ui to publish a next tag on commit to main. (#93) --- .github/workflows/test-and-tag.yml | 52 ++++++++++++++++++++++++++++++ .github/workflows/test.yml | 8 +---- requirements-ci.txt | 1 + 3 files changed, 54 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/test-and-tag.yml create mode 100644 requirements-ci.txt diff --git a/.github/workflows/test-and-tag.yml b/.github/workflows/test-and-tag.yml new file mode 100644 index 000000000..5eadf938f --- /dev/null +++ b/.github/workflows/test-and-tag.yml @@ -0,0 +1,52 @@ +name: Test & Publish Next + +on: + # The build will be triggered on push to main + push: + branches: + - main + +concurrency: + group: test-build-${{ github.ref_name }}-${{ github.event_name }} + cancel-in-progress: true + +jobs: + test-and-tag: + runs-on: ubuntu-latest + + steps: + + - uses: actions/checkout@v3 + with: + persist-credentials: false + fetch-depth: 0 + + - name: Install Node.js ๐Ÿ’ป + uses: actions/setup-node@v3 + with: + node-version: 18 + registry-url: https://registry.npmjs.org/ + + - name: Set up Python ๐Ÿ + uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - name: Set up Dunamai ๐Ÿช„ + run: pip install -r requirements-ci.txt + + - name: Install locked dependencies ๐Ÿ”ง + run: npm ci + + - name: Version โœ… + run: npm version --no-git-tag-version $(dunamai from git --style semver) + + - name: Test ๐Ÿงช + env: + TZ: America/New_York + run: npm test + + - name: Publish ๐Ÿ“š + run: npm publish --tag next --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index af5f8c6e5..6d9a86547 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,16 +1,10 @@ name: Test -on: [push, pull_request] +on: pull_request jobs: test: runs-on: ubuntu-latest - # We want to run on external PRs, but not on our own internal PRs as they'll be run - # by the push to the branch. This prevents duplicated runs on internal PRs. - # Some discussion of this here: - # https://github.community/t/duplicate-checks-on-push-and-pull-request-simultaneous-event/18012 - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository - steps: - name: Checkout ๐Ÿ›Ž๏ธ uses: actions/checkout@v3 diff --git a/requirements-ci.txt b/requirements-ci.txt new file mode 100644 index 000000000..787488408 --- /dev/null +++ b/requirements-ci.txt @@ -0,0 +1 @@ +dunamai==1.19.0 \ No newline at end of file