mirror of
https://github.com/shanmiteko/LotteryAutoScript.git
synced 2026-06-04 21:01:17 +08:00
ci: 修改github release镜像源
This commit is contained in:
parent
98948ad7f0
commit
989f836ba2
48
.github/workflows/pkg.yml
vendored
48
.github/workflows/pkg.yml
vendored
@ -53,27 +53,27 @@ jobs:
|
|||||||
delete_file: "dist/*.zip"
|
delete_file: "dist/*.zip"
|
||||||
tag_name: "v2"
|
tag_name: "v2"
|
||||||
overwrite: true
|
overwrite: true
|
||||||
# arm64:
|
arm64:
|
||||||
# runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# name: arm64
|
name: arm64
|
||||||
# steps:
|
steps:
|
||||||
# - name: "Checkout codes"
|
- name: "Checkout codes"
|
||||||
# uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
# - name: "Pkg this"
|
- name: "Pkg this"
|
||||||
# run: |
|
run: |
|
||||||
# sudo podman run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
sudo podman run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||||
# npm run pkg arm
|
npm run pkg arm
|
||||||
# - name: "Upload to artifact"
|
- name: "Upload to artifact"
|
||||||
# uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
# with:
|
with:
|
||||||
# name: arm64
|
name: arm64
|
||||||
# path: "dist/*.zip"
|
path: "dist/*.zip"
|
||||||
# - name: "Upload to release draft"
|
- name: "Upload to release draft"
|
||||||
# uses: xresloader/upload-to-github-release@v1
|
uses: xresloader/upload-to-github-release@v1
|
||||||
# env:
|
env:
|
||||||
# GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
# with:
|
with:
|
||||||
# file: "dist/*.zip"
|
file: "dist/*.zip"
|
||||||
# delete_file: "dist/*.zip"
|
delete_file: "dist/*.zip"
|
||||||
# tag_name: "v2"
|
tag_name: "v2"
|
||||||
# overwrite: true
|
overwrite: true
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,6 +6,7 @@ lottery_info/
|
|||||||
dist/
|
dist/
|
||||||
.env
|
.env
|
||||||
*.log
|
*.log
|
||||||
|
*.zip
|
||||||
package-lock.json
|
package-lock.json
|
||||||
env.js
|
env.js
|
||||||
my_config.js
|
my_config.js
|
||||||
@ -4,19 +4,21 @@ WORKDIR /root/lottery
|
|||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN npm config set registry https://registry.npm.taobao.org && npm i
|
# RUN npm config set registry https://registry.npm.taobao.org && npm i
|
||||||
|
RUN npm i
|
||||||
|
|
||||||
ENV DOWNLOAD_HOST=https://download.fastgit.org \
|
# ENV DOWNLOAD_HOST=https://ghproxy.com/https://github.com \
|
||||||
RELEASE_TAG=v3.4 \
|
ENV DOWNLOAD_HOST=https://github.com \
|
||||||
NODEV=18.5.0 \
|
RELEASE_TAG=v3.4 \
|
||||||
PKG_CACHE_PATH=/root/.pkg-cache \
|
NODEV=18.5.0 \
|
||||||
PKG_IGNORE_TAG=true
|
PKG_CACHE_PATH=/root/.pkg-cache \
|
||||||
|
PKG_IGNORE_TAG=true
|
||||||
|
|
||||||
RUN mkdir -p "${PKG_CACHE_PATH}" && \
|
RUN mkdir -p "${PKG_CACHE_PATH}" && \
|
||||||
curl -L "$DOWNLOAD_HOST/vercel/pkg-fetch/releases/download/$RELEASE_TAG/node-v$NODEV-linux-arm64" -o \
|
curl -L "$DOWNLOAD_HOST/vercel/pkg-fetch/releases/download/$RELEASE_TAG/node-v$NODEV-linux-arm64" -o \
|
||||||
"${PKG_CACHE_PATH}/fetched-v$NODEV-linux-arm64" && \
|
"${PKG_CACHE_PATH}/fetched-v$NODEV-linux-arm64" && \
|
||||||
curl -L "$DOWNLOAD_HOST/vercel/pkg-fetch/releases/download/$RELEASE_TAG/node-v$NODEV-linuxstatic-arm64" -o \
|
curl -L "$DOWNLOAD_HOST/vercel/pkg-fetch/releases/download/$RELEASE_TAG/node-v$NODEV-linuxstatic-arm64" -o \
|
||||||
"${PKG_CACHE_PATH}/fetched-v$NODEV-linuxstatic-arm64"
|
"${PKG_CACHE_PATH}/fetched-v$NODEV-linuxstatic-arm64"
|
||||||
|
|
||||||
CMD ["bash", "-c", "npx pkg -t node$NODEV-linuxstatic-arm64 -o dist/lottery-auto-script-node$NODEV-linuxstatic-arm64 . && \
|
CMD ["bash", "-c", "npx pkg -t node$NODEV-linuxstatic-arm64 -o dist/lottery-auto-script-node$NODEV-linuxstatic-arm64 . && \
|
||||||
npx pkg -t node$NODEV-linux-arm64 -o dist/lottery-auto-script-node$NODEV-linux-arm64 ."]
|
npx pkg -t node$NODEV-linux-arm64 -o dist/lottery-auto-script-node$NODEV-linux-arm64 ."]
|
||||||
|
|||||||
@ -65,17 +65,16 @@ async function update() {
|
|||||||
.filter(({ name }) => checkPlatform(name))
|
.filter(({ name }) => checkPlatform(name))
|
||||||
.map(({ browser_download_url }) => browser_download_url)
|
.map(({ browser_download_url }) => browser_download_url)
|
||||||
if (download_url.length) {
|
if (download_url.length) {
|
||||||
const proxy_host = ['download.fastgit.org']
|
|
||||||
await try_for_each(download_url.entries(), async ([i, url]) => {
|
await try_for_each(download_url.entries(), async ([i, url]) => {
|
||||||
let proxy_url = new URL(url)
|
let proxy_url = "https://ghproxy.com/";
|
||||||
proxy_url.host = proxy_host[0]
|
proxy_url += url
|
||||||
log.warn('自动下载', `切换代理${proxy_host[0]}`)
|
log.warn('自动下载', `切换代理${proxy_url}`)
|
||||||
await download(proxy_url.href, `latest_version${i}.zip`)
|
await download(proxy_url, `latest_version${i}.zip`)
|
||||||
.catch(async err => {
|
.catch(async err => {
|
||||||
log.error('自动下载', err)
|
log.error('自动下载', err)
|
||||||
proxy_url.host = 'github.com'
|
proxy_url = url
|
||||||
log.warn('自动下载', `使用原始链接github.com`)
|
log.warn('自动下载', `使用原始链接${proxy_url}`)
|
||||||
await download(proxy_url.href, `latest_version${i}.zip`)
|
await download(proxy_url, `latest_version${i}.zip`)
|
||||||
})
|
})
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user