Version bump #105
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
name: publish | |
on: [push, pull_request] | |
env: | |
PLUGIN_NAME: "CS2Interface" | |
DOTNET_SDK_VERSION: 9.0 | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4.1.1 | |
with: | |
submodules: recursive | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v4.0.0 | |
with: | |
dotnet-version: ${{ env.DOTNET_SDK_VERSION }} | |
- name: Verify .NET Core | |
run: dotnet --info | |
- name: Prepare for publishing | |
run: dotnet restore | |
- name: Publish | |
run: | | |
dotnet publish ${{ env.PLUGIN_NAME }} -c "Release" -o "out/generic" -p:ContinuousIntegrationBuild=true --nologo | |
mkdir -p ./out/dist/${{ env.PLUGIN_NAME }} | |
cp ./out/generic/${{ env.PLUGIN_NAME }}.dll ./out/dist/${{ env.PLUGIN_NAME }} | |
( cd ./out/generic/ ; cp --parents ./*/${{ env.PLUGIN_NAME }}.resources.dll ../dist/${{ env.PLUGIN_NAME }} || : ) | |
- name: Create README | |
uses: docker://pandoc/core:3.1 | |
with: | |
args: --metadata title="${{ env.PLUGIN_NAME }}" --standalone --columns 2000 -f markdown -t html --embed-resources --standalone -c ./github-pandoc.css -o ./out/dist/${{ env.PLUGIN_NAME }}/README.html README.md | |
- name: Upload ${{ env.PLUGIN_NAME }} | |
uses: actions/upload-artifact@v4.0.0 | |
with: | |
name: ${{ env.PLUGIN_NAME }} | |
path: out/dist/${{ env.PLUGIN_NAME }} | |
release: | |
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} | |
needs: publish | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
attestations: write | |
id-token: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4.1.1 | |
- name: Download ${{ env.PLUGIN_NAME }} artifact | |
uses: actions/download-artifact@v4.1.7 | |
with: | |
name: ${{ env.PLUGIN_NAME }} | |
path: out | |
- name: Create Zip | |
run: | | |
cd out | |
7z a -tzip -mx7 ${{ env.PLUGIN_NAME }}.zip * | |
- name: Generate artifact attestation | |
uses: actions/attest-build-provenance@v2 | |
with: | |
subject-path: 'out/${{ env.PLUGIN_NAME }}.zip' | |
- name: Create ${{ env.PLUGIN_NAME }} GitHub release | |
uses: ncipollo/release-action@v1.13.0 | |
with: | |
artifacts: out/${{ env.PLUGIN_NAME }}.zip | |
artifactContentType: application/zip | |
name: ${{ env.PLUGIN_NAME }} V${{ github.ref_name }} | |
tag: ${{ github.ref_name }} | |
bodyFile: .github/RELEASE_TEMPLATE.md | |
token: ${{ secrets.GITHUB_TOKEN }} | |
makeLatest: false | |
prerelease: true | |
draft: true |