This repository has been archived by the owner on Dec 19, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (63 loc) · 2.01 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: CI
on:
workflow_dispatch:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
env:
PACK_NAME: ""
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Pack
run: |
if [ ! $PACK_NAME ]; then
PACK_NAME=${GITHUB_REPOSITORY##*/}
fi
echo "PACK_NAME=$PACK_NAME" >> $GITHUB_ENV
cd $PACK_NAME
zip -r ../$PACK_NAME.opk ./
- name: Upload
uses: actions/upload-artifact@v3
with:
name: Artifacts
path: ${{ env.PACK_NAME }}.opk
# ----------------------------------------------#
- name: 读取当前版本号
id: version
uses: ashley-taylor/read-json-property-action@v1.0
with:
path: ./${{ env.PACK_NAME }}/app.json
property: version
- name: Release Drafter
id: releasedraft
uses: toolmantim/release-drafter@v5.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# # - name: 读取描述文件
# # id: description
# # uses: juliangruber/read-file-action@v1
# # with:
# # path: ./description.txt
- name: 创建GitHub Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{steps.version.outputs.value}}
release_name: v${{steps.version.outputs.value}}
body: ${{steps.releasedraft.outputs.content}} # ${{steps.description.outputs.content}}
draft: true # ${{steps.releasedraft.outputs.content}}
prerelease: false
- name: 上传文件
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.PACK_NAME }}.opk
asset_name: ${{ env.PACK_NAME }}.opk
asset_content_type: application/zip