From fa0fd25786f4dc95eb83aa8c5ff23ee83ee40c16 Mon Sep 17 00:00:00 2001 From: ZeWaka Date: Sun, 28 Jul 2024 19:48:50 -0700 Subject: [PATCH 1/5] a potential release workflow we could use --- .github/workflows/release.yml | 55 +++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..405e00f9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,55 @@ +name: Release Workflow + +on: + push: + tags: + - "v*.*.*" + +jobs: + release: + name: Generate Release + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: read + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'pnpm' + cache-dependency-path: './pnpm-lock.yaml' + + - name: Install dependencies + run: pnpm install + + - name: Lint project + run: pnpm lint + + - name: Build project + run: pnpm build + + - name: Commit changes + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add . + git commit -m "Build for Release" || echo "No changes to commit" + + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Build Changelog + id: build_changelog + uses: mikepenz/release-changelog-builder-action@v4 + + - name: Create GitHub release + uses: softprops/action-gh-release@v1 + with: + body: ${{steps.build_changelog.outputs.changelog}} From 00d8a2e5c8c71f62e0fa0677c976186e875f82b2 Mon Sep 17 00:00:00 2001 From: ZeWaka Date: Mon, 29 Jul 2024 05:57:40 -0700 Subject: [PATCH 2/5] Basic GitHub Actions Workflow (#6) --- .github/workflows/pr.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 00000000..bd357800 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,33 @@ +name: Lint & Build + +on: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'pnpm' + cache-dependency-path: './pnpm-lock.yaml' + + - name: Install dependencies + run: pnpm install + + - name: Run lint script + run: pnpm lint + + - name: Run build script + run: pnpm build From 6d7912b86d270016f565db0c959fe0095ab950df Mon Sep 17 00:00:00 2001 From: Zephyr <12817816+ZephyrTFA@users.noreply.github.com> Date: Mon, 29 Jul 2024 11:53:57 -0400 Subject: [PATCH 3/5] Update pr.yml (#8) --- .github/workflows/pr.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index bd357800..4eecf1c6 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -16,12 +16,13 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Install PNPM + run: npm i -g pnpm + - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: 20 - cache: 'pnpm' - cache-dependency-path: './pnpm-lock.yaml' - name: Install dependencies run: pnpm install From da3c0ff9244230a717e9303b8a0a6c344847171a Mon Sep 17 00:00:00 2001 From: ZeWaka Date: Fri, 2 Aug 2024 12:00:04 -0700 Subject: [PATCH 4/5] Add `format` prop to timedisplay (#9) Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com> --- lib/components/TimeDisplay.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/components/TimeDisplay.jsx b/lib/components/TimeDisplay.jsx index ab758256..6efeed65 100644 --- a/lib/components/TimeDisplay.jsx +++ b/lib/components/TimeDisplay.jsx @@ -59,6 +59,10 @@ export class TimeDisplay extends Component { return this.state.value || null; } - return formatTime(val); + if (this.props.format) { + return this.props.format(val); + } else { + return formatTime(val); + } } } From 71dddf5ac15e5994a755da48e58bb367bac4d136 Mon Sep 17 00:00:00 2001 From: ZeWaka Date: Wed, 7 Aug 2024 22:23:49 -0700 Subject: [PATCH 5/5] add npm publishing via `secrets.NPM_TOKEN` --- .github/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 405e00f9..8d1532ac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,3 +53,7 @@ jobs: uses: softprops/action-gh-release@v1 with: body: ${{steps.build_changelog.outputs.changelog}} + + - uses: JS-DevTools/npm-publish@v3 + with: + token: ${{ secrets.NPM_TOKEN }}