+
Skip to content

test workflow #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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: Install PNPM
run: npm i -g pnpm

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: pnpm install

- name: Run lint script
run: pnpm lint

- name: Run build script
run: pnpm build
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
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}}

- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
6 changes: 5 additions & 1 deletion lib/components/TimeDisplay.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载