-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from tobitege/master
Getting actions to work with versions was a PITA
- Loading branch information
Showing
59 changed files
with
381 additions
and
137,814 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- '.github/**/*.yml' | ||
- '.git*' | ||
- '.vscode' | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-2019 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup MSBuild | ||
uses: microsoft/setup-msbuild@v1 | ||
|
||
- name: Setup NuGet | ||
uses: NuGet/[email protected] | ||
|
||
- name: Navigate to Workspace | ||
run: cd $GITHUB_WORKSPACE | ||
|
||
- name: Get Assembly Version | ||
id: getversion | ||
uses: berglie/assembly-version/get@v1 | ||
with: | ||
filename: 'Version.txt' | ||
directory: '.' | ||
|
||
#- name: Create Tag | ||
# if: github.ref == 'refs/heads/master' # ONLY ON MASTER | ||
# id: create_tag | ||
# uses: jaywcjlove/create-tag-action@main | ||
# with: | ||
# release: true | ||
# version: ${{ steps.getversion.outputs.version }} | ||
|
||
#- name: Generate Changelog | ||
# if: steps.create_tag.outputs.successful | ||
# id: changelog | ||
# uses: jaywcjlove/changelog-generator@main | ||
# with: | ||
# head-ref: ${{steps.create_tag.outputs.version}} | ||
# filter-author: (tobitege|Dimencia) | ||
# filter: (^[\s]+?[R|r]elease)|(^[R|r]elease) | ||
|
||
- name: Restore Packages | ||
run: nuget restore DU-Industry-Tool.sln | ||
|
||
- name: Build Solution | ||
run: | | ||
msbuild.exe DU-Industry-Tool.sln /p:platform="Any CPU" /p:configuration="Release" | ||
#- name: Release Notes | ||
# id: release_notes | ||
# uses: suzuito/create-release-by-file@master | ||
# with: | ||
# release_note: ./changelog.md | ||
# prefix: '# ' | ||
# check_only: false | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Archive Release | ||
if: github.ref == 'refs/heads/master' # ONLY ON MASTER | ||
uses: thedoctor0/zip-release@main | ||
with: | ||
directory: DU-Industry-Tool/bin/Release/ | ||
type: 'zip' | ||
filename: DU-Industry-Tool-v${{ steps.getversion.outputs.version }}.zip | ||
exclusions: '*.git* /*node_modules/* *.exe.config *.xml *.pdb *.vs* *.user .editorconfig' | ||
|
||
- name: Create Github Release | ||
if: github.ref == 'refs/heads/master' # ONLY ON MASTER | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: v${{ steps.getversion.outputs.version }} | ||
release_name: DU-Industry-Tool-v${{ steps.getversion.outputs.version }} | ||
draft: true | ||
prerelease: false | ||
body_path: changelog.md | ||
|
||
- name: Upload release | ||
if: github.ref == 'refs/heads/master' # ONLY ON MASTER | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: DU-Industry-Tool/bin/Release/DU-Industry-Tool-v${{ steps.getversion.outputs.version }}.zip | ||
asset_name: DU-Industry-Tool-v${{ steps.getversion.outputs.version }}.zip | ||
asset_content_type: application/zip | ||
|
||
- name: Publish release | ||
if: github.ref == 'refs/heads/master' # ONLY ON MASTER | ||
uses: eregon/publish-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
release_id: ${{ steps.create_release.outputs.id }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.