-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (69 loc) · 3.73 KB
/
Copy pathbuild.yml
File metadata and controls
71 lines (69 loc) · 3.73 KB
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
# Workflow for building and creating a release
name: Build
on:
push:
branches:
- master
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Create Secrets
uses: danielr1996/envsubst-action@1.0.0
env:
GDRIVE_CLIENT_ID: ${{ secrets.GDRIVE_CLIENT_ID }}
GDRIVE_CLIENT_SECRET: ${{ secrets.GDRIVE_CLIENT_SECRET }}
GDRIVE_PROJECT_ID: ${{ secrets.GDRIVE_PROJECT_ID }}
with:
input: Utils/Secrets.ci.cs
output: Utils/Secrets.cs
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Get title & changelog
if: startsWith(github.ref, 'refs/tags/v')
run: bash ./git-changelog.sh
id: title-changelog
- name: Publish
if: startsWith(github.ref, 'refs/tags/v')
run: |
dotnet publish --configuration Release --framework net7.0 --runtime win-x86 --output ./publish/win-x86 --no-self-contained
dotnet publish --configuration Release --framework net7.0 --runtime win-x86 --output ./publish/win-x86-self --self-contained
dotnet publish --configuration Release --framework net7.0 --runtime win-x64 --output ./publish/win-x64 --no-self-contained
dotnet publish --configuration Release --framework net7.0 --runtime win-x64 --output ./publish/win-x64-self --self-contained
dotnet publish --configuration Release --framework net7.0 --runtime linux-x64 --output ./publish/linux-x64 --no-self-contained
dotnet publish --configuration Release --framework net7.0 --runtime linux-x64 --output ./publish/linux-x64-self --self-contained
dotnet publish --configuration Release --framework net7.0 --runtime linux-arm --output ./publish/linux-arm --no-self-contained
dotnet publish --configuration Release --framework net7.0 --runtime linux-arm --output ./publish/linux-arm-self --self-contained
dotnet publish --configuration Release --framework net7.0 --runtime osx-x64 --output ./publish/osx-x64 --no-self-contained
dotnet publish --configuration Release --framework net7.0 --runtime osx-x64 --output ./publish/osx-x64-self --self-contained
zip -j9 ./publish/google-drive-client_win-x86.zip ./publish/win-x86/*
zip -j9 ./publish/google-drive-client_win-x86_self-contained.zip ./publish/win-x86-self/*
zip -j9 ./publish/google-drive-client_win-x64.zip ./publish/win-x64/*
zip -j9 ./publish/google-drive-client_win-x64_self-contained.zip ./publish/win-x64-self/*
tar -cvzf ./publish/google-drive-client_linux-x64.tar.gz -C ./publish/linux-x64 .
tar -cvzf ./publish/google-drive-client_linux-x64_self-contained.tar.gz -C ./publish/linux-x64-self .
tar -cvzf ./publish/google-drive-client_linux-arm.tar.gz -C ./publish/linux-arm .
tar -cvzf ./publish/google-drive-client_linux-arm_self-contained.tar.gz -C ./publish/linux-arm-self .
tar -cvzf ./publish/google-drive-client_osx-x64.tar.gz -C ./publish/osx-x64 .
tar -cvzf ./publish/google-drive-client_osx-x64_self-contained.tar.gz -C ./publish/osx-x64-self .
- name: Create release
if: startsWith(github.ref, 'refs/tags/v')
uses: ncipollo/release-action@v1
with:
name: ${{ steps.title-changelog.outputs.TITLE }}
artifacts: "publish/google-drive-client_*"
body: ${{ steps.title-changelog.outputs.CHANGELOG }}
draft: false
prerelease: false