-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (41 loc) · 1.56 KB
/
auto-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: Automatic releases
on:
workflow_dispatch:
schedule:
- cron: '0 3 * * 0'
jobs:
build:
name: Build & publish
runs-on: ubuntu-latest
steps:
- name: Checkouting code...
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'
- name: Preparing nuget source
run: dotnet nuget add source --username SkyCD --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/SkyCD/index.json"
- name: Restoring packages
run: dotnet restore
- name: Build
run: dotnet build --configuration Release
- name: Releasing if there is something new...
uses: impresscms-dev/[email protected]
id: autorelease
with:
release_branch: main
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: minor
- name: Generating publishing params...
id: params
run: |
APP_VERSION=$(echo "${{ steps.autorelease.outputs.new_version }}" | sed -r 's/v//g')
echo "params=-p:Version=$APP_VERSION" >> $GITHUB_OUTPUT
shell: bash
- name: Pack
if: steps.autorelease.outputs.not_released == 'false'
run: dotnet pack --output ./artifacts --configuration Release ${{steps.params.outputs.params}}
- name: Publish to GitHub packages
if: steps.autorelease.outputs.not_released == 'false'
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "github"