-
Notifications
You must be signed in to change notification settings - Fork 5
52 lines (48 loc) · 1.77 KB
/
release.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
name: Release
on:
push:
tags: ['[0-9]+.[0-9]+.[0-9]+', '[0-9]+.[0-9]+.[0-9]+-pre[0-9]+']
permissions: write-all
env:
CONFIG: Release
TEMPLATE_PROJ: templates/FSharp.Mobile.Templates.proj
jobs:
release:
runs-on: macos-13
environment: nuget
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Extract version from tag
uses: damienaicheh/[email protected]
- name: Set release version
run: |
if [ "${PRE_RELEASE}" == "" ]; then
RELEASE_VERSION=${MAJOR}.${MINOR}.${PATCH}
else
RELEASE_VERSION=${MAJOR}.${MINOR}.${PATCH}-${PRE_RELEASE}
fi
echo "Release version is $RELEASE_VERSION"
echo "RELEASE_VERSION=$RELEASE_VERSION" >> "$GITHUB_ENV"
- name: Get FSharp.Mobile.Templates Changelog Entry
id: templates_changelog
uses: mindsers/changelog-reader-action@v2
with:
validation_level: warn
version: '${{ env.RELEASE_VERSION }}'
path: CHANGELOG.md
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Pack
run: |
find templates -type f -name template.json | xargs sed -i bak "s/PKG_VERSION/${RELEASE_VERSION}/g"
dotnet pack ${TEMPLATE_PROJ} -p:Version=${RELEASE_VERSION} -p:PackageReleaseNotes="${{ steps.templates_changelog.outputs.changes }}" -c ${CONFIG} --property PackageOutputPath=${PWD}/nupkgs
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: Packages
path: nupkgs/
- name: Push
run: dotnet nuget push "nupkgs/*" -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_TOKEN }} --skip-duplicate