-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (64 loc) · 2.16 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: release
on:
workflow_call:
secrets:
NUGET_TOKEN:
description: nuget.org access token
required: true
env:
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v2
- name: verify
run: |
echo "Verifying release commit is latest in the main branch"
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep "origin/main" || (echo "Commit is not found or not the latest in main branch" && exit 1)
echo "Commit verified"
- uses: actions/download-artifact@v2
with:
name: assemblies-${{ github.sha }}
path: ./dist
- name: pack
working-directory: ./dist
run: |
tar -czf Avolantis.Text.QueryString.${{ github.ref_name }}.tar.gz ./*
zip -r Avolantis.Text.QueryString.${{ github.ref_name }}.zip ./* -x *.tar.gz
- uses: actions/download-artifact@v2
with:
name: nupkg-${{ github.sha }}
path: ./dist
- name: nuget
if: contains(github.ref_name, '-') != 1
run: dotnet nuget push ${FILE} --api-key ${NUGET_TOKEN}
env:
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
FILE: ./dist/Avolantis.Text.QueryString.*.nupkg
- name: github
run: dotnet nuget push ${FILE} --api-key ${GITHUB_TOKEN} --source ${GITHUB_SOURCE}
env:
GITHUB_TOKEN: ${{ github.token }}
GITHUB_SOURCE: https://nuget.pkg.github.com/avolantis/index.json
FILE: ./dist/Avolantis.Text.QueryString.*.nupkg
- name: reports
uses: actions/download-artifact@v2
with:
name: reports-${{ github.sha }}
path: ./test/coverage
- name: release
uses: softprops/action-gh-release@v1
with:
prerelease: ${{ contains(github.ref_name, '-') }}
files: |
./LICENSE.md
./README.md
./dist/*
./test/coverage/*