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
60 lines (57 loc) · 1.67 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
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/[email protected]
with:
path: ./${{ env.PACK_NAME }}/app.json
property: version
- name: 读取描述文件(若有)
id: Changelog
uses: juliangruber/read-file-action@v1
with:
path: ./Changelog
- name: 创建GitHub Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
with:
tag_name: v${{steps.version.outputs.value}}
release_name: v${{steps.version.outputs.value}}
body: ${{steps.Changelog.outputs.content}}
draft: true
prerelease: false
- name: 上传opk文件
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
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