Skip to content

Commit

Permalink
Setup admin ui to publish a next tag on commit to main.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen committed Oct 13, 2023
1 parent ae44660 commit 160c577
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 7 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/test-and-tag.yml
Original file line number Diff line number Diff line change
@@ -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 }}
8 changes: 1 addition & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions requirements-ci.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dunamai==1.19.0

0 comments on commit 160c577

Please sign in to comment.