-
Notifications
You must be signed in to change notification settings - Fork 452
135 lines (133 loc) · 4.98 KB
/
publish.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: .NET
on:
push:
tags:
- '*'
jobs:
build:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: Get release tag
shell: bash
id: tag_name
run: echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
- name: Setup .NET 6
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.100
- name: Setup .NET 2.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.x
- name: Build OpenBullet2
run: dotnet publish OpenBullet2/OpenBullet2.csproj -c Release -o .publish/OpenBullet2
- name: Build Updater
run: dotnet publish Updater/Updater.csproj -c Release -o .publish/OpenBullet2
- name: Build Native
run: dotnet publish OpenBullet2.Native/OpenBullet2.Native.csproj -c Release -o .publish/OB2Native
- name: Build Console
run: dotnet publish OpenBullet2.Console/OpenBullet2.Console.csproj -c Release -o .publish/OB2Console
- name: Build Native Updater
run: dotnet publish Updater.Native/Updater.Native.csproj -c Release -o .publish/OB2Native
- name: get ncbeauty
run: dotnet tool install --global nulastudio.ncbeauty
- name: run ncbeauty
run: ncbeauty -nopatch -noflag D:/a/OpenBullet2/OpenBullet2/.publish/OB2Native/
- name: remove unwanted Files
shell: pwsh
run: Get-ChildItem .publish -recurse -include *.pdb,*.xml | remove-item -force
- name: Zip OpenBullet2
shell: pwsh
run: Compress-Archive -Path .publish/OpenBullet2/* -DestinationPath .publish/OpenBullet2.zip
- name: Zip OB2Native
shell: pwsh
run: Compress-Archive -Path .publish/OB2Native/* -DestinationPath .publish/OpenBullet2.Native.zip
- name: Zip OB2Console
shell: pwsh
run: Compress-Archive -Path .publish/OB2Console/* -DestinationPath .publish/OpenBullet2.Console.zip
- name: Upload OpenBullet2
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: '.publish/OpenBullet2.zip'
tag: ${{ steps.tag_name.outputs.SOURCE_TAG }}
overwrite: true
- name: Upload OB2Native
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: '.publish/OpenBullet2.Native.zip'
tag: ${{ steps.tag_name.outputs.SOURCE_TAG }}
overwrite: true
- name: Upload OB2Console
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: '.publish/OpenBullet2.Console.zip'
tag: ${{ steps.tag_name.outputs.SOURCE_TAG }}
overwrite: true
- name: Checkout Diffcopy repo
uses: actions/checkout@v2
with:
repository: openbullet/DiffCopy
path: DiffCopy
- name: Build Diffcopy
run: dotnet publish DiffCopy/DiffCopy.sln -c Release -o .tools/DiffCopy
- name: Download Baseline
shell: pwsh
run: Invoke-WebRequest -Uri "https://github.com/openbullet/OpenBullet2/releases/download/0.2.0/OpenBullet2.zip" -OutFile "baseline.zip"
- name: Unzip Baseline
shell: pwsh
run: Expand-Archive ./baseline.zip -DestinationPath ./baseline
- name: run Diffcopy
run: dotnet .tools/DiffCopy/DiffCopy.dll -s baseline/OpenBullet2 -n .publish/OpenBullet2 -o .publish/Patch
- name: Zip Patch
shell: pwsh
run: Compress-Archive -Path .publish/Patch/* -DestinationPath .publish/Patch.zip
- name: Upload Patch
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: '.publish/Patch.zip'
tag: ${{ steps.tag_name.outputs.SOURCE_TAG }}
overwrite: true
- name: update release
uses: tubone24/update_release@v1.3.1
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
with:
release_name: ${{ steps.tag_name.outputs.SOURCE_TAG }}
body: Please refer to [this post](https://discourse.openbullet.dev/t/wip-how-to-download-and-start-openbullet-2/29) on the official forum to learn how to launch OpenBullet 2.
push_to_docker:
name: Push Docker image to Docker Hub
needs: build
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Get release tag
shell: bash
id: dockertag
run: echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v2
with:
push: true
platforms: linux/arm/v7,linux/arm64/v8,linux/amd64
tags: openbullet/openbullet2:latest,openbullet/openbullet2:${{ steps.dockertag.outputs.SOURCE_TAG }}