Skip to content

Commit

Permalink
Merge pull request #10 from B3none/actions-build-zip
Browse files Browse the repository at this point in the history
actions updates
  • Loading branch information
B3none authored Jan 11, 2024
2 parents a71c5d6 + a2d4658 commit 2b6e1ee
Showing 1 changed file with 38 additions and 14 deletions.
52 changes: 38 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,47 @@ on:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
release:
types:
- created

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Publish DLL artifact
uses: actions/upload-artifact@v4
with:
name: RetakesPlugin-${{ github.sha }}
path: ./bin/Debug/net7.0/RetakesPlugin.dll
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Build
run: dotnet build
- name: Create output directory
run: |
mkdir -p output/RetakesPlugin
mv ./bin/Debug/net7.0/RetakesPlugin.dll output/RetakesPlugin/
mv ./map_configs output/RetakesPlugin/
mv ./lang output/RetakesPlugin/
- name: Publish Artifact
uses: actions/upload-artifact@v4
with:
name: RetakesPlugin-${{ github.sha }}
path: output

release:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'release'

steps:
- name: Extract Release Version
id: extract-release-version
run: echo "RELEASE_VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
with:
asset-path: ${{ github.workspace }}/RetakesPlugin.zip
asset-name: "cs2-retakes-${{ env.RELEASE_VERSION }}.zip"
repo-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 2b6e1ee

Please sign in to comment.