push jcdcdev/jcdcdev.Eco.Signs #35 #35
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: '🚀 Release mod' | |
run-name: > | |
push ${{github.repository}} #${{ github.run_number }} | |
on: | |
pull_request: | |
branches: | |
- main | |
types: [ closed ] | |
workflow_dispatch: | |
jobs: | |
determine-version: | |
runs-on: ubuntu-latest | |
outputs: | |
semVer: ${{ steps.gitversion.outputs.semVer }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/setup@v0 | |
with: | |
versionSpec: '5.x' | |
- name: Determine Version | |
id: gitversion | |
uses: gittools/actions/gitversion/execute@v0 | |
build: | |
name: build ${{ needs.determine-version.outputs.semVer }} | |
runs-on: ubuntu-latest | |
needs: determine-version | |
env: | |
SEMVER: ${{ needs.determine-version.outputs.semVer }} | |
ASSET_NAME: jcdcdev.Eco.Signs-${{ needs.determine-version.outputs.semVer }} | |
PROJECT_NAME: jcdcdev.Eco.Signs | |
PROJECT_PATH: ./src/jcdcdev.Eco.Signs/jcdcdev.Eco.Signs.csproj | |
MOD_OUTPUT: ./build-assets/Mods/jcdcdev.Eco.Signs | |
ARTIFACT_OUTPUT: ./build-assets | |
outputs: | |
assetName: ${{ env.ASSET_NAME }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download, Extract, and Copy DLLs | |
run: | | |
mkdir ./src/jcdcdev.Eco.Signs/lib | |
wget -O file.zip https://api.mod.io/v1/games/6/mods/2595901/files/5475460/download | |
unzip -d extracted_files file.zip | |
find extracted_files -name "*.dll" -exec cp {} ./src/jcdcdev.Eco.Signs/lib \; | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 7.0.x | |
- name: Build project | |
run: dotnet build ${{ env.PROJECT_PATH }} -o ${{ env.MOD_OUTPUT }} --configuration Release -p:Version=${{ env.SEMVER }} | |
- uses: vimtor/action-zip@v1 | |
with: | |
files: ${{ env.ARTIFACT_OUTPUT }} | |
dest: ${{ env.ASSET_NAME }}.zip | |
- name: Upload package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ASSET_NAME }} | |
path: ${{ env.ASSET_NAME }}.zip | |
deploy: | |
needs: | |
- determine-version | |
- build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
env: | |
SEMVER: ${{ needs.determine-version.outputs.semVer }} | |
ASSET_NAME: ${{ needs.build.outputs.assetName }} | |
steps: | |
- name: Create Release | |
id: create-release | |
uses: jcdcdev/jcdcdev.GitHub.CreateRelease@main | |
with: | |
artifact-name: ${{ env.ASSET_NAME }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
version: ${{ env.SEMVER }} | |
rich-format: false | |
- name: Download package | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.ASSET_NAME }} | |
- uses: nickelc/[email protected] | |
with: | |
token: ${{ secrets.MODIO_TOKEN }} | |
game: ${{ secrets.MODIO_GAME }} | |
mod: ${{ secrets.MODIO_MOD }} | |
version: ${{ env.SEMVER }} | |
path: ${{ env.ASSET_NAME }}.zip | |
active: true | |
changelog: ${{ steps.create-release.outputs.changelog }} | |
sync-readme: | |
needs: | |
- deploy | |
uses: ./.github/workflows/sync-readme.yml | |
secrets: inherit | |
permissions: | |
contents: write | |
pull-requests: write |