-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (97 loc) · 3.07 KB
/
release.yml
File metadata and controls
108 lines (97 loc) · 3.07 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
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
name: SQLite / Release
on:
push:
# On Push to Master branch
branches:
- master
# Ignore all Tags / Release
tags-ignore:
- '**'
workflow_dispatch:
jobs:
changes:
name: Changes
runs-on: ubuntu-latest
outputs:
changes: ${{ steps.changes.outputs.nuget }}
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
nuget:
- '**.nuspec'
version:
name: Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.info }}
notes: ${{ steps.notes.outputs.info }}
steps:
- uses: actions/checkout@v6
- name: Get Package Version
id: version
uses: mavrosxristoforos/get-xml-info@2.0
with:
xml-file: "SQLite/Sqlite.nuspec"
xpath: "//*[local-name()='package']/*[local-name()='metadata']/*[local-name()='version']"
- name: Get Package Release Notes
id: notes
uses: mavrosxristoforos/get-xml-info@2.0
with:
xml-file: "SQLite/Sqlite.nuspec"
xpath: "//*[local-name()='package']/*[local-name()='metadata']/*[local-name()='releaseNotes']"
- name: Print Version
id: print-output
run: echo "${{ steps.version.outputs.info }} - ${{ steps.notes.outputs.info }}"
release:
name: Release
needs:
- changes
- version
permissions:
contents: write
packages: write
if: ${{ needs.changes.outputs.changes == 'true' }}
runs-on: windows-2022
steps:
- name: Git Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Pack
run: nuget.exe pack Sqlite.nuspec
working-directory: ${{ github.workspace }}\SQLite
- name: Push Package to GitHub registry
run: |
dotnet nuget add source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" --name github --username ${{ github.repository_owner }} --password ${{ secrets.GITHUB_TOKEN }}
dotnet nuget push "**\*.nupkg" --source github --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate --no-symbols
- name: Release
uses: softprops/action-gh-release@v2
with:
name: SQLite ${{ needs.version.outputs.version }}
tag_name: ${{ needs.version.outputs.version }}
body: ${{ needs.version.outputs.notes }}
generate_release_notes: true
files: |
SQLite/*.nupkg
ci-status:
name: Status
runs-on: ubuntu-latest
needs:
- release
if: always()
steps:
- name: Success
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Failure
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1