Skip to content

Commit 2d7c890

Browse files
authored
Merge pull request #12 from Myriadbits/Rayden84-branch
Merging Rayden84 branch into master
2 parents 6f46453 + 1a662de commit 2d7c890

File tree

470 files changed

+22480
-60026
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

470 files changed

+22480
-60026
lines changed

.github/workflows/release.yml

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
name: Create release from tag
2+
3+
#on:
4+
# push:
5+
# branches:
6+
# - testaction
7+
8+
on:
9+
push:
10+
tags:
11+
- 'v*'
12+
13+
jobs:
14+
get_version:
15+
name: Get version tag
16+
runs-on: ubuntu-latest
17+
outputs:
18+
version: ${{ steps.get_version.outputs.VERSION }}
19+
steps:
20+
- name: Get the (cleaned) tag string
21+
id: get_version
22+
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
23+
24+
- name: Echo the tag (for debugging)
25+
run: echo ${{ steps.get_version.outputs.VERSION }}
26+
27+
create_builds:
28+
name: Build, test, publish & zip
29+
needs: get_version
30+
runs-on: windows-latest
31+
env:
32+
VERSION_TAG: "${{ needs.get_version.outputs.version }}"
33+
ARTIFACT_NAME: "MXFInspect-${{ needs.get_version.outputs.version }}-${{ matrix.fw-flavor }}-win-${{ matrix.win-version }}"
34+
strategy:
35+
matrix:
36+
# cfg:
37+
# - { win-version: x64, fw-flavor: fwdependent}
38+
# - { win-version: x86, fw-flavor: fwdependent}
39+
# - { win-version: x64, fw-flavor: selfcontained, selfcontained-type: no-singlefile}
40+
# - { win-version: x86, fw-flavor: selfcontained, selfcontained-type: no-singlefile}
41+
# - { win-version: x64, fw-flavor: selfcontained, selfcontained-type: singlefile}
42+
# - { win-version: x86, fw-flavor: selfcontained, selfcontained-type: singlefile}
43+
# - { win-version: x64, fw-flavor: selfcontained, selfcontained-type: singlefile, inclusion: includenativelibs}
44+
# - { win-version: x86, fw-flavor: selfcontained, selfcontained-type: singlefile, inclusion: includenativelibs}
45+
# - { win-version: x64, fw-flavor: selfcontained, selfcontained-type: singlefile, inclusion: includeallcontent}
46+
# - { win-version: x86, fw-flavor: selfcontained, selfcontained-type: singlefile, inclusion: includeallcontent}
47+
win-version: [x64, x86]
48+
fw-flavor: [fwdependent, selfcontained, selfcontained-singlefile, self-contained-includenativelibs, self-contained-includeallcontent]
49+
50+
steps:
51+
- uses: actions/checkout@v2
52+
- name: Show environment variables (for debugging)
53+
shell: bash
54+
run: |
55+
echo "VERSION_TAG = $VERSION_TAG"
56+
echo "ARTIFACT_NAME = $ARTIFACT_NAME"
57+
58+
- name: Setup .NET
59+
uses: actions/setup-dotnet@v1
60+
with:
61+
dotnet-version: 6.0.x
62+
63+
- name: fix for messed up github virtual env
64+
run: Remove-Item $env:APPDATA\NuGet\NuGet.Config
65+
66+
- name: Restore dependencies
67+
run: dotnet restore
68+
69+
- name: Build
70+
run: dotnet build --no-restore
71+
72+
- name: Test
73+
run: dotnet test --no-build --verbosity normal
74+
75+
- name: Publish release (framework dependent) in subfolder
76+
if: ${{ matrix.fw-flavor == 'fwdependent' }}
77+
run: dotnet publish MXFInspect -o publish -r win-${{ matrix.win-version }}
78+
79+
- name: Publish release (selfcontained) in subfolder
80+
if: ${{ matrix.fw-flavor == 'selfcontained' }}
81+
run: dotnet publish MXFInspect -o publish -r win-${{ matrix.win-version }} --self-contained true
82+
83+
- name: Publish release (selfcontained-singlefile) in subfolder
84+
if: ${{ matrix.fw-flavor == 'selfcontained-singlefile' }}
85+
run: dotnet publish MXFInspect -o publish -r win-${{ matrix.win-version }} --self-contained true -p:PublishSingleFile=true
86+
87+
- name: Publish relase (selfcontained-includenativelibraries) in subfolder
88+
if: ${{ matrix.fw-flavor == 'self-contained-includenativelibs' }}
89+
run: dotnet publish MXFInspect -o publish -r win-${{ matrix.win-version }} --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
90+
91+
- name: Publish release (selfcontained-includeallcontent) in subfolder
92+
if: ${{ matrix.fw-flavor == 'self-contained-includeallcontent' }}
93+
run: dotnet publish MXFInspect -o publish -r win-${{ matrix.win-version }} --self-contained true -p:PublishSingleFile=true -p:IncludeAllContentForselfExtract=true
94+
95+
- name: Create a file and zip it
96+
shell: bash
97+
run: |
98+
7z a ${{ env.ARTIFACT_NAME }}.zip ./publish/* LICENSE -bb
99+
100+
- name: Upload multiple artifact
101+
uses: actions/upload-artifact@v2
102+
with:
103+
name: ${{ env.ARTIFACT_NAME }}
104+
path: ./${{ env.ARTIFACT_NAME }}.zip
105+
106+
107+
do_release:
108+
name: Create release
109+
needs: [get_version, create_builds]
110+
runs-on: ubuntu-latest
111+
env:
112+
VERSION: "${{ needs.get_version.outputs.version }}"
113+
outputs:
114+
url: ${{ steps.create_release.outputs.upload_url }}
115+
steps:
116+
- name: Show the version tag (for debugging)
117+
run: echo "VERSION = $VERSION"
118+
119+
- name: Create a release
120+
id: create_release
121+
uses: actions/create-release@v1
122+
env:
123+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
124+
with:
125+
tag_name: ${{ env.VERSION }}
126+
release_name: ${{ env.VERSION }} Release of MXFInspect
127+
#body_path: CHANGELOG.md
128+
# body: |
129+
# Changes in this Release
130+
# - First Change
131+
# - Second Change
132+
draft: false
133+
prerelease: true
134+
135+
136+
upload_release:
137+
name: Upload release artifacts
138+
needs: [get_version, do_release]
139+
runs-on: ubuntu-latest
140+
env:
141+
VERSION: "${{ needs.get_version.outputs.version }}"
142+
ARTIFACT_NAME: "MXFInspect-${{ needs.get_version.outputs.version }}-${{ matrix.fw-flavor }}-win-${{ matrix.win-version }}"
143+
UPLOAD_URL: "${{ needs.do_release.outputs.url }}"
144+
strategy:
145+
matrix:
146+
win-version: [x64, x86]
147+
fw-flavor: [fwdependent, selfcontained, selfcontained-singlefile, self-contained-includenativelibs, self-contained-includeallcontent]
148+
steps:
149+
- name: Show environment variables (for debugging)
150+
run: |
151+
echo "VERSION = $VERSION"
152+
echo "ARTIFACT_NAME = $ARTIFACT_NAME"
153+
echo "UPLOAD_URL = $UPLOAD_URL"
154+
155+
- name: Download build artifact
156+
uses: actions/download-artifact@v2
157+
with:
158+
name: ${{ env.ARTIFACT_NAME }}
159+
160+
- name: Upload build artifacts to release
161+
id: upload-release-asset
162+
uses: actions/upload-release-asset@v1
163+
env:
164+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
165+
with:
166+
upload_url: ${{ env.UPLOAD_URL }}
167+
asset_path: ./${{ env.ARTIFACT_NAME }}.zip
168+
asset_name: ${{ env.ARTIFACT_NAME }}.zip
169+
asset_content_type: application/zip

0 commit comments

Comments
 (0)