Skip to content

Commit

Permalink
add release function
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaochunqi committed Sep 22, 2024
1 parent 85b525d commit 717d7c1
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "starred-to-logseq-action",
"version": "1.1.2",
"version": "1.1.3",
"description": "",
"main": "dist/index.js",
"scripts": {
Expand Down
1 change: 0 additions & 1 deletion src/fetchRepos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 717d7c1

Please sign in to comment.