-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (104 loc) · 2.63 KB
/
cli.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
name: CLI
on:
pull_request:
branches: ['main']
paths:
- .github/actions/**
- .github/workflows/cli.yml
- cli/**
- src/Cli/**
- src/Cli.Tests/**
push:
branches: ['main']
tags: ['v*.*.*']
paths:
- .github/actions/**
- .github/workflows/cli.yml
- cli/**
- src/Cli/**
- src/Cli.Tests/**
env:
CI: true
ContinuousIntegrationBuild: true
jobs:
build-cli:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
- uses: ./.github/actions/build-cs
id: upload
with:
codecov-token: ${{ secrets.CODECOV_TOKEN }}
restore-tools: true
lint: true
pack: ${{ github.event_name == 'push' }}
path: src/Cli
outputs:
artifact-id: ${{ steps.upload.outputs.artifact-id }}
publish-cli:
runs-on: ubuntu-latest
if: github.event_name == 'push'
needs: ['build-cli']
strategy:
matrix:
source: ['nuget', 'github']
env:
PACKAGE_PATTERN: UnMango.Tdl.*.nupkg
permissions:
packages: write
steps:
- uses: actions/download-artifact@v4
with:
name: nuget
- name: Publish to NuGet.org
if: matrix.source == 'nuget'
run: |
dotnet nuget push "$PACKAGE_PATTERN" \
--source https://api.nuget.org/v3/index.json \
--api-key ${{ secrets.NUGET_API_KEY }} \
--skip-duplicate
- name: Publish to GitHub Packages
if: matrix.source == 'github'
run: |
dotnet nuget push "$PACKAGE_PATTERN" \
--source https://nuget.pkg.github.com/${{ github.repository_owner }} \
--api-key ${{ secrets.GITHUB_TOKEN }} \
--skip-duplicate
build-go:
runs-on: ubuntu-latest
strategy:
matrix:
tool:
- uml2go
- uml2pcl
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build-go
with:
path: cli/${{ matrix.tool }}
gomod: cli/go.mod
goreleaser:
runs-on: ubuntu-latest
if: github.event_name == 'push'
needs: [build-go]
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '>=1.22.2'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}