Skip to content

Commit 83a6e17

Browse files
authored
Merge pull request #10 from tgharold/setup-env-variable-1
set env.PROJECT variable in release YML
2 parents 110bebb + 7b7ec3a commit 83a6e17

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

.github/workflows/upload-release-asset.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ on:
88

99
name: Upload Release Asset
1010

11-
# TODO: Set a variable to equal RecursiveDataAnnotationsValidation
11+
env:
12+
PROJECT: RecursiveDataAnnotationsValidation
1213

1314
jobs:
1415
build:
@@ -31,15 +32,15 @@ jobs:
3132
run: dotnet test --configuration Release
3233

3334
- name: dotnet publish
34-
working-directory: ./src/RecursiveDataAnnotationsValidation
35+
working-directory: ./src/${{ env.PROJECT }}
3536
run: dotnet publish --configuration Release
3637

3738
- name: Create ZIP
38-
working-directory: ./src/RecursiveDataAnnotationsValidation
39+
working-directory: ./src/${{ env.PROJECT }}
3940
run: |
40-
zip --junk-paths RecursiveDataAnnotationsValidation-${{ github.ref }}.zip |
41-
bin/Release/netstandard2.0/publish/RecursiveDataAnnotationsValidation.pdb |
42-
bin/Release/netstandard2.0/publish/RecursiveDataAnnotationsValidation.dll
41+
zip --junk-paths ${{ env.PROJECT }}-${{ github.ref }}.zip |
42+
bin/Release/netstandard2.0/publish/${{ env.PROJECT }}.pdb |
43+
bin/Release/netstandard2.0/publish/${{ env.PROJECT }}.dll
4344
# TODO: Add a README to the ZIP?
4445

4546
- name: Create Release
@@ -56,11 +57,10 @@ jobs:
5657
- name: Upload Release Asset
5758
id: upload-release-asset
5859
uses: actions/upload-release-asset@v1
59-
working-directory: ./src/RecursiveDataAnnotationsValidation
6060
env:
6161
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6262
with:
6363
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
64-
asset_path: ./RecursiveDataAnnotationsValidation-${{ github.ref }}.zip
65-
asset_name: RecursiveDataAnnotationsValidation-${{ github.ref }}.zip
64+
asset_path: ./src/${{ env.PROJECT }}/${{ env.PROJECT }}-${{ github.ref }}.zip
65+
asset_name: ${{ env.PROJECT }}-${{ github.ref }}.zip
6666
asset_content_type: application/zip

0 commit comments

Comments
 (0)