forked from webben-de/ASF_ItemDropper
-
Notifications
You must be signed in to change notification settings - Fork 4
129 lines (109 loc) · 4.17 KB
/
action_ci.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: ASF_ItemDropper-CI
on: [push, pull_request]
env:
CONFIGURATION: Release
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
DOTNET_SDK_VERSION: 5.0.x
NET_CORE_VERSION: net5.0
NET_FRAMEWORK_VERSION: net48
jobs:
main:
strategy:
matrix:
#os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_SDK_VERSION }}
- name: Verify .NET Core
run: dotnet --info
- name: Install dependencies
run: dotnet restore
- name: Build ASF_ItemDropper
run: dotnet build -c "${{ env.CONFIGURATION }}" --no-restore --nologo
#- name: Run ASF_ItemDropper.Tests
#run: dotnet test ASF_ItemDropper.Tests -c "${{ env.CONFIGURATION }}" -p:UseAppHost=false --nologo
- name: Publish ASF_ItemDropper for .NET Core
run: |
dotnet publish -c "${{ env.CONFIGURATION }}" -f "${{ env.NET_CORE_VERSION }}" -o "out/generic" -p:LinkDuringPublish=false --nologo
# - name: Publish ASF_ItemDropper for .NET Framework
# run: |
# dotnet publish -c "${{ env.CONFIGURATION }}" -f "${{ env.NET_FRAMEWORK_VERSION }}" -o "out/generic-netf" -p:LinkDuringPublish=false --nologo
- name: Show build environment 1
shell: bash
run: |
set -eu
pwd
ls -la
echo "GitHub ref: ${{ github.ref }}"
- name: Copy additinal files to ASF_ItemDropper generic artifacts
shell: bash
run: |
set -eu
cp ASFItemDropper/idropdeflist.txt out/generic/
- name: Upload ASF_ItemDropper generic artifacts
uses: actions/upload-artifact@v2
with:
# Artifact name
name: ${{ github.event.repository.name }}-generic
# Destination path(s)
path: |
out/generic/ASFItemDropper.*
out/generic/idropdeflist.txt
if-no-files-found: warn # 'error', 'warn' or 'ignore' are also available, defaults to `warn`
- name: Show build environment 2
shell: bash
run: |
set -eu
pwd
ls -la
ls -la out/
ls -la out/generic
# - name: Upload ASF_ItemDropper generic-netf artifacts
# uses: actions/upload-artifact@v2
# with:
# # Artifact name
# name: ${{ github.event.repository.name }}-generic-netf
# # Destination path(s)
# path: |
# out/generic-netf/ASFItemDropper.*
# idropdeflist.txt
# if-no-files-found: warn # 'error', 'warn' or 'ignore' are also available, defaults to `warn`
- name: Prepare ASF_ItemDropper release archive
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
shell: bash
run: |
set -eu
7z a -bd -slp -tzip -mx=7 out/ASFItemDropper-generic.zip ./out/generic/ASFItemDropper*.dll ./out/generic/idropdeflist.txt
7z t out/ASFItemDropper-generic.zip
7z l out/ASFItemDropper-generic.zip
- name: Create ASF_ItemDropper GitHub release
id: create_release
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ASF_ItemDropper v${{ github.ref }}
body_path: .github/PRERELEASE_TEMPLATE.md
prerelease: true
- name: Upload ASF_ItemDropper to GitHub release
id: upload-release-asset
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: out/ASFItemDropper-generic.zip
asset_name: ASFItemDropper-generic.zip
asset_content_type: application/zip