generated from xhofe/solid-lib
-
Notifications
You must be signed in to change notification settings - Fork 480
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
141 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,23 +6,7 @@ on: | |
- main | ||
|
||
jobs: | ||
changelog: | ||
name: Create release changelog | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Generate changelog | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: npx changelogithub # or [email protected] if ensure the stable result | ||
env: | ||
GITHUB_TOKEN: ${{secrets.MY_TOKEN}} | ||
|
||
build: | ||
needs: changelog | ||
strategy: | ||
matrix: | ||
platform: [ubuntu-latest] | ||
|
@@ -46,73 +30,27 @@ jobs: | |
uses: actions/checkout@v2 | ||
with: | ||
ref: main | ||
path: alist-web | ||
persist-credentials: false | ||
fetch-depth: 0 | ||
submodules: recursive | ||
|
||
- name: Checkout dist repo | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: alist-org/web-dist | ||
ref: main | ||
path: web-dist | ||
persist-credentials: false | ||
fetch-depth: 0 | ||
|
||
- name: Replace version | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
version=$(git describe --abbrev=0 --tags) | ||
sed -i -e "s/0.0.0/$version/g" alist-web/package.json | ||
- name: Build | ||
run: | | ||
cd alist-web | ||
pnpm install | ||
pnpm i18n | ||
pnpm build | ||
cp -r dist ../ | ||
cd .. | ||
env: | ||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} | ||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} | ||
|
||
- name: Copy dist and commit | ||
run: | | ||
cd web-dist | ||
rm -rf dist | ||
cp -r ../dist . | ||
git add . | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Noah Hsu" | ||
git commit --allow-empty -m "upload dist files" -a | ||
cd .. | ||
- name: Upload dist files | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.MY_TOKEN }} | ||
branch: main | ||
directory: web-dist | ||
repository: alist-org/web-dist | ||
|
||
- name: Publish npm | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
cd alist-web | ||
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc | ||
pnpm publish --no-git-checks | ||
cd .. | ||
- name: Compress dist files | ||
if: startsWith(github.ref, 'refs/tags/') | ||
- name: Compress dist | ||
run: | | ||
mkdir compress | ||
tar -czvf compress/dist.tar.gz dist/* | ||
zip -r compress/dist.zip dist/* | ||
- name: Release | ||
if: startsWith(github.ref, 'refs/tags/') | ||
uses: softprops/action-gh-release@v1 | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
files: compress/* | ||
name: alist-web | ||
path: compress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
|
||
jobs: | ||
changelog: | ||
name: Create release changelog | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Generate changelog | ||
run: npx changelogithub # or [email protected] if ensure the stable result | ||
env: | ||
GITHUB_TOKEN: ${{secrets.MY_TOKEN}} | ||
|
||
release: | ||
needs: changelog | ||
strategy: | ||
matrix: | ||
platform: [ubuntu-latest] | ||
name: Release | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Setup Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: "16" | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- uses: pnpm/[email protected] | ||
name: Install pnpm | ||
id: pnpm-install | ||
with: | ||
version: 7 | ||
run_install: false | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: main | ||
path: alist-web | ||
persist-credentials: false | ||
fetch-depth: 0 | ||
submodules: recursive | ||
|
||
- name: Checkout dist repo | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: alist-org/web-dist | ||
ref: main | ||
path: web-dist | ||
persist-credentials: false | ||
fetch-depth: 0 | ||
|
||
- name: Build | ||
run: | | ||
mv alist-web/release.sh . | ||
bash release.sh | ||
env: | ||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} | ||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} | ||
|
||
- name: Publish npm | ||
run: | | ||
cd alist-web | ||
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc | ||
pnpm publish --no-git-checks | ||
cd .. | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Upload dist files | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.MY_TOKEN }} | ||
branch: main | ||
directory: web-dist | ||
repository: alist-org/web-dist | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: compress/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,23 @@ | ||
{ | ||
"name": "alist-web", | ||
"version": "0.0.0", | ||
"description": "", | ||
"author": { | ||
"name": "Xhofe", | ||
"email": "[email protected]", | ||
"url": "https://www.nn.ci" | ||
}, | ||
"description": "The front end of Alist V3", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/alist-org/alist-web.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/Xhofe/alist/issues" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"homepage": "https://alist.nn.ci", | ||
"scripts": { | ||
"crowdin": "crowdin download", | ||
"i18n": "pnpm crowdin -b main --verbose && node ./scripts/i18n.mjs", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# replace version | ||
cd alist-web | ||
version=$(git describe --abbrev=0 --tags) | ||
sed -i -e "s/0.0.0/$version/g" package.json | ||
cat package.json | ||
|
||
# build | ||
pnpm install | ||
pnpm i18n | ||
pnpm build | ||
cp -r dist ../ | ||
cd .. | ||
|
||
# commit to web-dist | ||
cd web-dist | ||
rm -rf dist | ||
cp -r ../dist . | ||
git add . | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Noah Hsu" | ||
git commit --allow-empty -m "upload $version dist files" -a | ||
git tag -a $version -m "release $version" | ||
cd .. | ||
|
||
mkdir compress | ||
tar -czvf compress/dist.tar.gz dist/* | ||
zip -r compress/dist.zip dist/* |