-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (43 loc) · 1.51 KB
/
release-github.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: (NuGet) GitHub Packages Release
on:
workflow_run:
workflows: [ "Build" ]
types:
- completed
jobs:
github_packages_release:
name: GitHub Packages Release
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event != 'pull_request' }}
runs-on: ubuntu-20.04
env:
# GitHub Packages Feed settings
GITHUB_USER: ${{ github.repository_owner }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_FEED: https://nuget.pkg.github.com/${{ github.repository_owner }}
GITHUB_PACKAGES_OUTPUT: ${{ github.workspace }}/github_packages
# Project Setup
PROJECT_NAME: ${{ github.event.repository.name }}
steps:
- name: Checkout master
uses: actions/checkout@v4
with:
ref: master
fetch-depth: 0
- name: Get version
shell: bash
run: |
tag_check=$(git describe --exact-match `git rev-parse HEAD` | head -1)
echo "VERSION=$tag_check" >> $GITHUB_ENV
- name: Download a single artifact
uses: aochmann/[email protected]
with:
name: nuget_${{ env.PROJECT_NAME }}.${{ env.VERSION }}
path: ${{ env.GITHUB_PACKAGES_OUTPUT }}
- name: Push to GitHub Feed
shell: bash
working-directory: ${{ env.GITHUB_PACKAGES_OUTPUT }}
run: |
for nugetFile in ./*.nupkg
do
curl -vX PUT -u "$GITHUB_USER:$GITHUB_TOKEN" -F package=@$nugetFile $GITHUB_FEED
done