Skip to content

Commit

Permalink
Merge pull request #13 from tobitege/master
Browse files Browse the repository at this point in the history
Getting actions to work with versions was a PITA
  • Loading branch information
Dimencia authored Aug 29, 2022
2 parents b0b72c4 + b4bfa73 commit 18781ca
Show file tree
Hide file tree
Showing 59 changed files with 381 additions and 137,814 deletions.
106 changes: 106 additions & 0 deletions .github/workflows/main.yml
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 }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ bld/

# Visual Studio 2015/2017 cache/options directory
.vs/

# Visual Studio Code cache/options directory
.vcode/

# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

Expand Down
Loading

0 comments on commit 18781ca

Please sign in to comment.