-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (43 loc) · 1.52 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
---
name: publish
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
- v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+
env:
RELEASE_BUILD: "true"
RELEASE_PUBLICATION: "true"
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: build
run: |
dotnet publish RewriteCSharpRecipes.sln
- name: Update Directory.Build.props version from tag
run: |
sed -i -E "s/<VersionPrefix>.*<\/VersionPrefix>/<VersionPrefix>${GITHUB_REF#refs/tags/v}<\/VersionPrefix>/g" Directory.Build.props
- name: publish-dotnet-release
if: (!contains(github.ref, '-rc.'))
run: |
mkdir ~/localNugetFeed
dotnet pack --output ~/localNuGetFeed RewriteCSharpRecipes.sln
dotnet nuget push ~/localNuGetFeed/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{env.NUGET_API_KEY}}
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
- name: Commit version updates
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add Directory.Build.props
git commit -m "bump version ${GITHUB_REF#refs/tags/}"
git push https://${GH_TOKEN}@github.com/openrewrite/rewrite-csharp.git HEAD:main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}