-
Notifications
You must be signed in to change notification settings - Fork 80
72 lines (63 loc) · 2.49 KB
/
publish-release.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
70
71
72
name: Publish release zip
on:
push:
tags:
- 'OFDLV*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup dotnet 7.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.x
- name: Display dotnet version
run: dotnet --version
- name: Extract version
id: version
run: |
VERSION="${GITHUB_REF_NAME#OFDLV}"
echo "Version: $VERSION"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Run build
run: |
dotnet publish -p:Version=${{ steps.version.outputs.version }} -p:WarningLevel=0 -c Release -r win-x86 --self-contained true -p:PublishSingleFile=true -o outwin
dotnet publish -p:Version=${{ steps.version.outputs.version }} -p:WarningLevel=0 -c Release -r linux-x64 --self-contained true -p:PublishSingleFile=true -o outlin
cp ./OF\ DL/rules.json outwin/
chmod +x ./outlin/OF\ DL
cd outwin
../outlin/OF\ DL --non-interactive || true
../outlin/OF\ DL --non-interactive || true
mkdir -p cdm/devices/chrome_1610
zip ../OFDLV${{ steps.version.outputs.version }}.zip OF\ DL.exe e_sqlite3.dll rules.json config.json auth.json cdm
zip ../Config-OFDLV${{ steps.version.outputs.version }}.zip *.json cdm
cd ..
- name: Create release
uses: actions/create-release@v1
id: create_release
with:
draft: true
prerelease: false
release_name: ${{ steps.version.outputs.version }}
tag_name: ${{ github.ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Windows zip
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./OFDLV${{ steps.version.outputs.version }}.zip
asset_name: OFDLV${{ steps.version.outputs.version }}.zip
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload config zip
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Config-OFDLV${{ steps.version.outputs.version }}.zip
asset_name: Config-OFDLV${{ steps.version.outputs.version }}.zip
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}