Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit 6322300

Browse files
author
Mark Hall
authored
Merge pull request #12 from episerver/add-github-action
Add GitHub action
2 parents 3f5afd8 + bc7d28a commit 6322300

File tree

5 files changed

+82
-5
lines changed

5 files changed

+82
-5
lines changed

.github/workflows/ci.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Continuous integration
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
- 'add-github-action'
8+
workflow_dispatch:
9+
jobs:
10+
build_test_pack:
11+
name: Build, test & pack
12+
runs-on: windows-latest
13+
env:
14+
buildConfiguration: release
15+
outputs: # https://stackoverflow.com/questions/59175332/using-output-from-a-previous-job-in-a-new-one-in-a-github-action
16+
Version: ${{ steps.gitversion.outputs.nuGetVersionV2 }}
17+
CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v2
21+
with:
22+
fetch-depth: 0 #fetch-depth is needed for GitVersion
23+
24+
# install and calculate the new version with GitVersion
25+
- name: Install GitVersion
26+
uses: gittools/actions/gitversion/[email protected]
27+
with:
28+
versionSpec: '5.x'
29+
- name: Determine Version
30+
uses: gittools/actions/gitversion/[email protected]
31+
id: gitversion # step id used as reference for output values
32+
- name: Display GitVersion outputs
33+
run: |
34+
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}"
35+
echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}"
36+
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}"
37+
38+
- name: Setup .NET Core @ Latest
39+
uses: actions/setup-dotnet@v1
40+
- name: Build
41+
run: dotnet build --configuration $env:buildConfiguration -p:Version=${{ steps.gitversion.outputs.nuGetVersionV2 }}
42+
- name: Create Release
43+
id: create_release
44+
uses: actions/create-release@v1
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
47+
with:
48+
tag_name: v${{ steps.gitversion.outputs.nuGetVersionV2 }}
49+
release_name: EPi.Source.Updater.${{ steps.gitversion.outputs.nuGetVersionV2 }}
50+
draft: false
51+
prerelease: false
52+
- name: upload windows artifact
53+
uses: actions/upload-release-asset@v1
54+
env:
55+
GITHUB_TOKEN: ${{ github.token }}
56+
with:
57+
upload_url: ${{ steps.create_release.outputs.upload_url }}
58+
asset_path: ./src/EpiSourceUpdater/bin/Release\netstandard2.0/Epi.Source.Updater.zip
59+
asset_name: EPi.Source.Updater.${{ steps.gitversion.outputs.nuGetVersionV2 }}.zip
60+
asset_content_type: application/zip
61+

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,5 @@ PublishScripts/
9090
!.vscode/launch.json
9191
!.vscode/extensions.json
9292
/src/AspNetMigrator.Console/Properties/launchSettings.json
93+
out/
94+
outpublish/

EPiServerExtensions.sln

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.31410.357
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31903.59
55
MinimumVisualStudioVersion = 15.0.26124.0
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F9838F04-6B40-4C69-8478-251AD71CA780}"
77
EndProject
88
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Epi.Source.Updater", "src\EpiSourceUpdater\Epi.Source.Updater.csproj", "{F5753EA0-0EDC-4C8A-B8D5-9BC251EBA9FF}"
99
EndProject
10+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{C531B306-EEDA-4A6F-831F-4D822A5DB8D4}"
11+
ProjectSection(SolutionItems) = preProject
12+
.github\workflows\ci.yml = .github\workflows\ci.yml
13+
EndProjectSection
14+
EndProject
1015
Global
1116
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1217
Debug|Any CPU = Debug|Any CPU

GitVersion.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
mode: Mainline
2+
next-version: 1.0.4
3+
branches:
4+
main:
5+
tag: ''
6+
feature:
7+
tag: 'ci'
8+
develop:
9+
tag: 'pre'
10+
ignore:
11+
sha: []
12+
merge-message-formats: {}

src/EpiSourceUpdater/Epi.Source.Updater.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<AssemblyName>Epi.Source.Updater</AssemblyName>
66
<LangVersion>latest</LangVersion>
7-
<AssemblyVersion>1.0.1.0</AssemblyVersion>
8-
<FileVersion>1.0.1.0</FileVersion>
9-
<Version>1.0.1</Version>
107
</PropertyGroup>
118

129
<ItemGroup>

0 commit comments

Comments
 (0)