Skip to content

4.4.0

4.4.0 #28

Workflow file for this run

name: Publish package
on:
release:
types: [published] # run when a new release is published
tags:
- 'v*' # Trigger only if the tag matches eg. v1.0.0
env:
name: ChebsMythicalWeapons
jsonf: manifest.json
dlpath: https://github.com/jpw1991/chebs-mythical-weapons/releases/download
dependencies: "[email protected]" # dependencies separated by spaces
categories: "Mods" # categories separated by spaces
namespace: ChebGonaz
jobs:
verify-manifest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check that version matches
run: |
version=$(grep -Po "AssemblyVersion\(\"\K([0-9]+\.[0-9]+\.[0-9]+)" ${{env.name}}/Properties/AssemblyInfo.cs)
versionfrommanifest="$(jq -r '.version_number' $(find ./${{env.name}}/Package -name ${{env.jsonf}}))"
[ -z "$version" ] && echo "::error::version is empty!" && exit 1
[ -z "$versionfrommanifest" ] && echo "::error::versionfrommanifest is empty!" && exit 1
if [[ $versionfrommanifest != $version ]]; then
echo "::error::Version in ${{env.jsonf}} does not match assembly version"
exit 1
fi
echo "VERSION=${version}" >> $GITHUB_ENV
- name: Get Description
id: get_description
run: |
description=$(jq -r '.description' $(find ./${{env.name}}/Package -name ${{env.jsonf}}))
echo "DESCRIPTION=${description}" >> $GITHUB_ENV
publish:
runs-on: ubuntu-latest
needs: verify-manifest
steps:
- uses: actions/checkout@v3
- run: wget ${{env.dlpath}}/${{github.ref_name}}/${{env.name}}.${{env.VERSION}}.zip
- name: Upload Thunderstore Package
uses: GreenTF/upload-thunderstore-package@v4
with:
community: valheim
namespace: ${{env.namespace}}
name: ${{env.name}}
version: ${{env.VERSION}}
description: ${{env.DESCRIPTION}}
token: ${{secrets.TS_KEY}}
deps: ${{env.dependencies}}
categories: ${{env.categories}}
file: ${{env.name}}.${{env.VERSION}}.zip