diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7cb3ae6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,45 @@ +name: Create Release + +on: + push: + branches: + - main + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "18" + + - name: Get version from package.json + id: package-version + uses: martinbeentjes/npm-get-version-action@master + + - name: Create Release + id: create_release + uses: ncipollo/release-action@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag: v${{ steps.package-version.outputs.current-version }} + name: Release ${{ steps.package-version.outputs.current-version }} + draft: false + prerelease: false + + - name: Update major version tag + run: | + git config user.name github-actions + git config user.email github-actions@github.com + MAJOR_VERSION=$(echo ${{ steps.package-version.outputs.current-version }} | cut -d. -f1) + git tag -fa v${MAJOR_VERSION} -m "Update v${MAJOR_VERSION} tag" + git push origin v${MAJOR_VERSION} --force diff --git a/package.json b/package.json index b2534d3..da2e3d2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "starred-to-logseq-action", - "version": "1.1.2", + "version": "1.1.3", "description": "", "main": "dist/index.js", "scripts": { diff --git a/src/fetchRepos.ts b/src/fetchRepos.ts index d53f383..8bc4a1b 100644 --- a/src/fetchRepos.ts +++ b/src/fetchRepos.ts @@ -6,7 +6,6 @@ function formatDate(date: string) { return moment(date).format("YYYY-MM-DD dddd"); } -// 添加延迟函数 const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); export const fetchRepos = async (