-
Notifications
You must be signed in to change notification settings - Fork 12
51 lines (42 loc) · 1.96 KB
/
version-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
# Action to build and release a new version of the project
# The workflow is triggered when a new release is created.
# The workflow builds the projectand uploads the EDMXTrimmer.zip file to the release.
# The workflow uses the GitHub Actions upload-release-asset action to upload the EDMXTrimmer.zip file to the release.
# The action takes a number of parameters, which are documented in the action's repository.
name: Build and add to release
# trigger on a release
on:
release:
types: [published]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: dotnet build --configuration Release EDMXTrimmer
- name: Test
run: dotnet test --logger:nunit --configuration Release EDMXTrimmer
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/composite@v2
with:
files: '**/TestResults/*.xml'
comment_mode: 'off'
- name: Publish
run: dotnet publish --configuration Release EDMXTrimmer/EDMXTrimmer --output zip
- name: Upload EDMXTrimmer_${{ github.event.release.tag_name }}.zip
uses: actions/upload-artifact@v3
with:
name: EDMXTrimmer_${{ github.event.release.tag_name }}
path: zip
- name: Create zip file from content of zip folder
run: Compress-Archive -Path zip\* -DestinationPath EDMXTrimmer_${{ github.event.release.tag_name }}.zip
- name: Upload EDMXTrimmer .zip to release ${{ github.event.release.name }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: https://uploads.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets?name=EDMXTrimmer_${{ github.event.release.tag_name }}.zip
asset_path: EDMXTrimmer_${{ github.event.release.tag_name }}.zip
asset_name: EDMXTrimmer_${{ github.event.release.tag_name }}.zip
asset_content_type: application/zip