feat: polish the release GitHub action (#395)
This commit is contained in:
parent
e992d8ed92
commit
e10b7757fd
|
@ -1,41 +0,0 @@
|
||||||
name: build documentation and publish
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: remove all file except icon.png
|
|
||||||
run: find . -type f -not \( -name '*.yml' \) -delete
|
|
||||||
- name: Pushes to another repository
|
|
||||||
uses: cpina/github-action-push-to-another-repository@main
|
|
||||||
env:
|
|
||||||
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB2 }}
|
|
||||||
with:
|
|
||||||
source-directory: './Apps'
|
|
||||||
destination-github-username: 'IceWhaleTech'
|
|
||||||
destination-repository-name: '_appstore'
|
|
||||||
user-email: q2676515970@163.com
|
|
||||||
target-directory: './Apps'
|
|
||||||
- name: Copycat
|
|
||||||
uses: andstor/copycat-action@v3
|
|
||||||
with:
|
|
||||||
personal_token: ${{ secrets.API_TOKEN_GITHUB2 }}
|
|
||||||
src_path: ./recommend-list.json
|
|
||||||
dst_owner: IceWhaleTech
|
|
||||||
dst_repo_name: _appstore
|
|
||||||
email: q2676515970@163.com
|
|
||||||
src_branch: main
|
|
||||||
dst_branch: main
|
|
||||||
- name: Error Handling
|
|
||||||
if: ${{ failure() }}
|
|
||||||
run: |
|
|
||||||
curl -X POST -H "Content-Type: application/json" -d '{"msg_type":"text","content":{"text":"CasaOS-AppStore build and publish error"}}' ${{ secrets.APPSTORE_ROBOT_URL }}
|
|
||||||
|
|
|
@ -14,6 +14,11 @@ jobs:
|
||||||
run: find . -name "screenshot*" | xargs rm -f
|
run: find . -name "screenshot*" | xargs rm -f
|
||||||
- name: remove all thumbnails
|
- name: remove all thumbnails
|
||||||
run: find . -name "thumbnail*" | xargs rm -f
|
run: find . -name "thumbnail*" | xargs rm -f
|
||||||
|
- name: remove all icon
|
||||||
|
run: find . -name "icon.png" | xargs rm -f
|
||||||
|
- name: remove all app file
|
||||||
|
run: find . -name "appfile.json" | xargs rm -f
|
||||||
|
|
||||||
- name: create a build with sysroot
|
- name: create a build with sysroot
|
||||||
id: build
|
id: build
|
||||||
run: |
|
run: |
|
||||||
|
@ -38,6 +43,7 @@ jobs:
|
||||||
- name: Get version
|
- name: Get version
|
||||||
id: get_version
|
id: get_version
|
||||||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
|
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
|
||||||
|
|
||||||
- name: Upload to oss
|
- name: Upload to oss
|
||||||
id: upload_to_oss
|
id: upload_to_oss
|
||||||
uses: tvrcgo/upload-to-oss@master
|
uses: tvrcgo/upload-to-oss@master
|
||||||
|
|
|
@ -14,6 +14,11 @@ jobs:
|
||||||
run: find . -name "screenshot*" | xargs rm -f
|
run: find . -name "screenshot*" | xargs rm -f
|
||||||
- name: remove all thumbnails
|
- name: remove all thumbnails
|
||||||
run: find . -name "thumbnail*" | xargs rm -f
|
run: find . -name "thumbnail*" | xargs rm -f
|
||||||
|
- name: remove all icon
|
||||||
|
run: find . -name "icon.png" | xargs rm -f
|
||||||
|
- name: remove all app file
|
||||||
|
run: find . -name "appfile.json" | xargs rm -f
|
||||||
|
|
||||||
- name: create a build with sysroot
|
- name: create a build with sysroot
|
||||||
id: build
|
id: build
|
||||||
run: |
|
run: |
|
||||||
|
@ -27,10 +32,15 @@ jobs:
|
||||||
pushd /tmp
|
pushd /tmp
|
||||||
zip -r main.zip build
|
zip -r main.zip build
|
||||||
|
|
||||||
- name: Copy
|
- name: Checkout pages
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: gh-pages
|
||||||
|
path: pages
|
||||||
|
|
||||||
|
- name: Copy build to pages
|
||||||
run: |
|
run: |
|
||||||
mkdir pages
|
cp /tmp/main.zip pages/store/main.zip
|
||||||
cp /tmp/main.zip pages/main.zip
|
|
||||||
|
|
||||||
- name: Pushes to another repository
|
- name: Pushes to another repository
|
||||||
uses: cpina/github-action-push-to-another-repository@main
|
uses: cpina/github-action-push-to-another-repository@main
|
||||||
|
@ -38,7 +48,19 @@ jobs:
|
||||||
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB2 }}
|
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB2 }}
|
||||||
with:
|
with:
|
||||||
source-directory: 'pages'
|
source-directory: 'pages'
|
||||||
destination-github-username: 'CasaOS-AppStore'
|
destination-github-username: 'IceWhaleTech'
|
||||||
destination-repository-name: 'casaos-appstore.github.io'
|
destination-repository-name: 'CasaOS-AppStore'
|
||||||
|
target-branch: 'gh-pages'
|
||||||
user-email: wiki@casaos.io
|
user-email: wiki@casaos.io
|
||||||
target-directory: 'heads'
|
target-directory: ''
|
||||||
|
|
||||||
|
- name: Upload to oss
|
||||||
|
id: upload_to_oss
|
||||||
|
uses: tvrcgo/upload-to-oss@master
|
||||||
|
with:
|
||||||
|
key-id: ${{ secrets.OSS_KEY_ID }}
|
||||||
|
key-secret: ${{ secrets.OSS_KEY_SECRET }}
|
||||||
|
region: oss-cn-shanghai
|
||||||
|
bucket: casaos
|
||||||
|
assets: |
|
||||||
|
/tmp/main.zip:/store/main.zip
|
Loading…
Reference in New Issue