Skip to content

Commit

Permalink
Merge 407e468 into f730178
Browse files Browse the repository at this point in the history
  • Loading branch information
bc3tech authored Mar 7, 2021
2 parents f730178 + 407e468 commit 3d818be
Showing 1 changed file with 49 additions and 3 deletions.
52 changes: 49 additions & 3 deletions .github/workflows/build-and-pack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@ on:
- '**.md'
- 'LICENSE'

env:
APP_VERSION: "0.1.${{ github.run_id }}"

jobs:
build-and-package:
runs-on: windows-latest
steps:
- name: debug
run: "echo app version: $APP_VERSION"

- uses: actions/checkout@v2

- name: Setup .NET
Expand All @@ -24,10 +30,16 @@ jobs:
dotnet-version: 5.0.x

- name: dotnet publish
run: dotnet publish --self-contained -r win-x64 -f net5.0 -c release /p:Version=0.1-$env:GITHUB_RUN_ID
run: dotnet publish --self-contained -r win-x64 -f net5.0 -c release /p:Version=${{ env.APP_VERSION }}

- name: Upload binaries
uses: actions/upload-artifact@v2
with:
name: binaries
path: bin\Release\net5.0\win-x64\publish\**

- name: Package
run: cd choco && choco pack --version 0.1.$env:GITHUB_RUN_ID
run: cd choco && choco pack --version ${{ env.APP_VERSION }}

- name: Upload nupkg
uses: actions/upload-artifact@v2
Expand All @@ -43,6 +55,7 @@ jobs:
uses: actions/download-artifact@v2
with:
name: nupkg

- name: publish to chocolatey community feed
env:
PUSH_URL: ${{ secrets.PUSH_URL }}
Expand All @@ -52,4 +65,37 @@ jobs:
foreach ($pkg in $nupkgs) {
Write-Host "Pushing: $($pkg.FullName) ..."
choco push "$($pkg.FullName)" -s "$env:PUSH_URL" -k "$env:API_KEY"
}
}
create-release:
needs:
- build-and-package
runs-on: ubuntu-latest
steps:
- name: Download a single artifact
uses: actions/download-artifact@v2
with:
name: binaries
path: bin

- name: Easy Zip Files
uses: vimtor/action-zip@v1
with:
dest: "Filesorter_${{ env.APP_VERSION }}.zip"
files: bin/

- uses: actions/checkout@v2

- name: Push new tag
uses: negz/create-tag@v1
with:
version: ${{ env.APP_VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Publish GitHub release
uses: softprops/action-gh-release@v1
with:
files: "Filesorter_${{ env.APP_VERSION }}.zip"
tag_name: ${{ env.APP_VERSION }}
prerelease: ${{ github.ref != 'refs/heads/main'}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 3d818be

Please sign in to comment.