-
Notifications
You must be signed in to change notification settings - Fork 13
49 lines (41 loc) · 1.35 KB
/
action.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
name: GitHub Action
on: [push]
env:
DOTNET_NOLOGO: true
NBGV_VERSION: 3.1.91
GprToolCsprojPath: src/GprTool/GprTool.csproj
config: Release
branch: action
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
jobs:
build-and-test:
name: publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- uses: dotnet/[email protected]
with:
setAllVars: true
- name: Setup dotnet using global.json
uses: actions/[email protected]
- run: dotnet publish $GprToolCsprojPath -c ${{ env.config }}
- name: Publish GitHub Action
run: |
cd $PUBLISH_PATH
git init
git checkout -b ${{ env.branch }}
git remote add origin https://token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git fetch
git reset origin/${{ env.branch }}
git add .
git config --global user.name "Jamie Cansdale"
git config --global user.email "[email protected]"
git commit -m "Add published files from ${{ github.sha }}"
git push --set-upstream origin ${{ env.branch }} --force
git tag $TAG_NAME
git push origin $TAG_NAME
env:
TAG_NAME: v${{ env.NBGV_SemVer2 }}
PUBLISH_PATH: src/GprTool/bin/${{ env.config }}/netcoreapp3.0/publish