forked from abnerfs/cs2-rockthevote
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
65 additions
and
74 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 |
---|---|---|
@@ -1,54 +1,70 @@ | ||
name: dotnet package | ||
name: .NET Build and Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
push: | ||
branches: | ||
- main | ||
- master | ||
- dev | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
- dev | ||
|
||
jobs: | ||
build: | ||
env: | ||
dllName: RockTheVote | ||
debugPath: /home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}/bin/Debug | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
dotnet-version: [ '8.0.x' ] | ||
|
||
container: | ||
image: mcr.microsoft.com/dotnet/nightly/sdk:8.0 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup dotnet | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: ${{ matrix.dotnet-version }} | ||
|
||
- name: Install dependencies | ||
run: dotnet restore | ||
|
||
- name: Build | ||
run: dotnet build | ||
|
||
- name: Create zip | ||
run: cd ${debugPath} && mv net8.0 $dllName && zip -r ${dllName}.zip ${dllName} | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | ||
asset_path: ${{env.debugPath}}/${{env.dllName}}.zip | ||
asset_name: ${{env.dllName}}_${{github.ref_name}}.zip | ||
asset_content_type: application/zip | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Build | ||
run: dotnet publish --configuration Debug | ||
|
||
- name: Archive production artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: net8.0-artifacts | ||
path: | | ||
bin/Debug/net8.0/publish/RockTheVote* | ||
release: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: net8.0-artifacts | ||
path: bin/Debug/net8.0 | ||
|
||
- name: Create Tag | ||
id: tag_version | ||
run: | | ||
DATE=$(date +'%y.%m.%d-%H%M%S') | ||
echo "RELEASE_TAG=$DATE" >> $GITHUB_ENV | ||
- name: Determine if Pre-release | ||
id: prerelease | ||
run: | | ||
if [ "${{ github.ref }}" != "refs/heads/main" ]; then | ||
echo "IS_PRERELEASE=true" >> $GITHUB_ENV | ||
else | ||
echo "IS_PRERELEASE=false" >> $GITHUB_ENV | ||
fi | ||
- name: Create Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: ${{ env.RELEASE_TAG }} | ||
files: bin/Debug/net8.0/* | ||
prerelease: ${{ env.IS_PRERELEASE }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
This file was deleted.
Oops, something went wrong.