-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc4bd02
commit eb07c99
Showing
1 changed file
with
32 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ on: | |
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
jobs: | ||
build: | ||
build_pack: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
|
@@ -27,72 +27,36 @@ jobs: | |
- name: Test | ||
run: dotnet test --no-restore --verbosity normal | ||
|
||
pack: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 5.0.100 | ||
- name: Pack library | ||
run: dotnet pack -o ./Packed -c Release -p:Deterministic=true | ||
- uses: actions/[email protected] | ||
with: | ||
name: PackedLibrary | ||
path: ./Packed | ||
publish: | ||
runs-on: ubuntu-latest | ||
needs: pack | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 5.0.100 | ||
- name: Download package | ||
uses: actions/[email protected] | ||
with: | ||
name: PackedLibrary | ||
path: ./Packed | ||
- name: Publish to github package registry | ||
run: dotnet nuget push -s 'https://nuget.pkg.github.com/Ilia-Kosenkov/index.json' -k $GITHUB_TOKEN --skip-duplicate ./Packed/*nupkg | ||
release: | ||
runs-on: ubuntu-latest | ||
needs: publish | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Creating release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
- name: Download package | ||
uses: actions/[email protected] | ||
with: | ||
name: PackedLibrary | ||
path: ./Packed | ||
- name: Get exact package name | ||
run: echo "ARTIFACT_FNAME=$(ls ./Packed/*nupkg | grep -Po '(?<=/)[^/]+?$')" >> $GITHUB_ENV | ||
- name: Get package path | ||
run: echo "ARTIFACT_PATH=$(ls ./Packed/*nupkg)" >> $GITHUB_ENV | ||
- name: Add artifact | ||
uses: actions/upload-release-asset@v1 | ||
|
||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ${{ env.ARTIFACT_PATH }} | ||
asset_name: ${{ env.ARTIFACT_FNAME }} | ||
asset_content_type: application/zip | ||
- name: Pack library | ||
run: dotnet pack -o ./Packed -c Release -p:Deterministic=true | ||
- name: Upload nuget | ||
uses: actions/[email protected] | ||
with: | ||
name: PackedLibrary | ||
path: ./Packed | ||
- name: Publish to github package registry | ||
run: dotnet nuget push -s 'https://nuget.pkg.github.com/Ilia-Kosenkov/index.json' -k $GITHUB_TOKEN --skip-duplicate ./Packed/*nupkg | ||
|
||
- name: Creating release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Get exact package name and path | ||
run: | | ||
echo "ARTIFACT_FNAME=$(ls ./Packed/*nupkg | grep -Po '(?<=/)[^/]+?$')" >> $GITHUB_ENV | ||
echo "ARTIFACT_PATH=$(ls ./Packed/*nupkg)" >> $GITHUB_ENV | ||
- name: Add artifact | ||
uses: actions/upload-release-asset@v1 | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ${{ env.ARTIFACT_PATH }} | ||
asset_name: ${{ env.ARTIFACT_FNAME }} | ||
asset_content_type: application/zip | ||
|
||
|