-
Notifications
You must be signed in to change notification settings - Fork 2
101 lines (97 loc) · 3.38 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
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
name: CI
on:
pull_request:
branches: [ master ]
workflow_dispatch:
inputs:
version:
description: 'Release version to create'
required: true
jobs:
build:
strategy:
matrix:
include:
- os: linux
runner: ubuntu-20.04
- os: windows
runner: windows-latest
- os: macos
runner: macos-latest
runs-on: ${{ matrix.runner }}
name: Build ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
dotnet-quality: 'preview'
- name: Publish
run: |
dotnet publish -o out
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: pdfmerge-${{ matrix.os }}-x64
path: |
out/
!out/*.pdb
!out/*.dbg
!out/*.dsym/**
publish:
needs: build
runs-on: ubuntu-latest
name: Publish release
if: ${{ github.event.inputs.version != '' && github.actor == 'MichalStrehovsky' }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Download all artifacts
uses: actions/download-artifact@v3
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.event.inputs.version }}
release_name: v${{ github.event.inputs.version }}
draft: true
- name: Create tag
run: |
git tag v${{ github.event.inputs.version }}
git push origin v${{ github.event.inputs.version }}
- name: ZIP up
run: |
(cd pdfmerge-windows-x64 && zip -r ../pdfmerge-${{ github.event.inputs.version }}-windows-x64.zip .)
(cd pdfmerge-linux-x64 && zip -r ../pdfmerge-${{ github.event.inputs.version }}-linux-x64.zip .)
(cd pdfmerge-macos-x64 && zip -r ../pdfmerge-${{ github.event.inputs.version }}-macos-x64.zip .)
- name: Upload windows-x64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: pdfmerge-${{ github.event.inputs.version }}-windows-x64.zip
asset_name: pdfmerge-${{ github.event.inputs.version }}-windows-x64.zip
asset_content_type: application/zip
- name: Upload linux-x64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: pdfmerge-${{ github.event.inputs.version }}-linux-x64.zip
asset_name: pdfmerge-${{ github.event.inputs.version }}-linux-x64.zip
asset_content_type: application/zip
- name: Upload macos-x64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: pdfmerge-${{ github.event.inputs.version }}-macos-x64.zip
asset_name: pdfmerge-${{ github.event.inputs.version }}-macos-x64.zip
asset_content_type: application/zip