This commit is contained in:
MSWS
2025-03-06 18:49:59 -08:00
parent e58411cdd2
commit 30645de6c8
2 changed files with 38 additions and 9 deletions

View File

@@ -49,23 +49,52 @@ jobs:
mkdir -p publish/addons/counterstrikesharp/plugins/SharpTimer/
find ./publish -mindepth 1 -maxdepth 1 ! -name 'cfg' ! -name 'gamedata' -exec mv {} publish/addons/counterstrikesharp/plugins/SharpTimer/ \;
mv gamedata/ ./publish/addons/counterstrikesharp/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: SharpTimer
path: publish/*
if-no-files-found: error
- name: Set version tag and zip file name
id: version
run: |
VERSION="v1.0.${{ github.run_number }}"
if [[ $GITHUB_REF == 'refs/heads/dev' ]]; then
TAG="Prerelease $VERSION"
else
TAG="$VERSION"
fi
ZIP_NAME="SharpTimer_${VERSION}.zip"
echo "TAG=$TAG" >> $GITHUB_ENV
echo "ZIP_NAME=$ZIP_NAME" >> $GITHUB_ENV
- name: Zip published files
run: |
cd publish
zip -r ${{ env.ZIP_NAME }} .
- name: Create GitHub Release
uses: ncipollo/release-action@v1.16.0
with:
name: ${{ env.TAG }}
artifacts: publish/${{ env.ZIP_NAME }}
prerelease: ${{ contains(github.ref, 'dev') }}
tag: v1.0.${{ github.run_number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
post_webhook:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/dev'
steps:
- name: POST Webhook
run: |
curl -X POST \
--fail \
-F token=${{ secrets.GITLAB_SECRET_TOKEN }} \
-F ref=dev \
https://gitlab.edgegamers.io/api/v4/projects/2683/trigger/pipeline
- name: POST Webhook
run: |
curl -X POST \
--fail \
-F token=${{ secrets.GITLAB_SECRET_TOKEN }} \
-F ref=dev \
https://gitlab.edgegamers.io/api/v4/projects/2683/trigger/pipeline

View File

@@ -16,7 +16,7 @@
<PackageReference Include="System.Data.SQLite" Version="1.0.118"/>
</ItemGroup>
<ItemGroup>
<Content Include=".github\workflows\build.yml"/>
<Content Include=".github\workflows\nightly.yml" />
<Content Include="lang\**\*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>lang\%(RecursiveDir)%(Filename)%(Extension)</Link>