0.0.5 Skybox Texture Update #43
Workflow file for this run
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 package | |
on: | |
release: | |
types: [published] # run when a new release is published | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'version to be used instead of a detected release' | |
default: '' | |
type: string | |
required: true | |
env: | |
name: ${{github.event.repository.name}} # Edit this if the package name differs from the repo name | |
jobs: | |
verify: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get clean version | |
run: | | |
echo cleanVersion=$(echo ${{github.ref_name}} | sed s/v//g) >> $GITHUB_ENV | |
- name: Check that version matches | |
run: | | |
if [[ ${{ github.event_name }} == 'workflow_dispatch' ]]; then | |
exit 0 # Don't validate manually entered versions | |
fi | |
if [[ "$(grep -Po "\d+\.\d+\.\d+" $(find ./ -name mod.json))" != "${{ env.cleanVersion }}" ]]; then | |
echo "::debug::${{env.cleanVersion}}" | |
echo "::debug::$(cat $(find ./ -name mod.json ))" | |
echo "::error::Version in mod.json does not match tag version" | |
exit 1 | |
fi | |
publish: | |
runs-on: ubuntu-latest | |
needs: verify | |
steps: | |
- name: Get clean version # Duplicating code is cool, actually | |
run: | | |
if [[ ${{ github.event_name }} == 'workflow_dispatch' ]]; then | |
echo cleanVersion=$(echo ${{ inputs.version }}) >> $GITHUB_ENV | |
else | |
echo cleanVersion=$(echo ${{github.ref_name}} | sed s/v//g) >> $GITHUB_ENV | |
fi | |
- uses: actions/checkout@v3 | |
- run: | | |
cat ${{ github.workspace }}/compressed/assets.tar.gz.* > ${{ github.workspace }}/compressed/assets.tar.gz # concat assets | |
tar -xvf ${{ github.workspace }}/compressed/assets.tar.gz # extract concatinated assets | |
rm -f ${{ github.workspace }}/compressed/assets.tar.gz* # delete assets | |
- name: Upload Thunderstore Package | |
uses: GreenTF/upload-thunderstore-package@v3.1 | |
with: | |
community: northstar | |
# Name of the team to publish the mod under | |
# This should be modified if your github username is different than your team name on Thunderstore | |
namespace: odds # <------ DOUBLE CHECK THIS | |
# Name of the package | |
name: ${{ env.name }} # This can be modified if the package name differs from the repo name | |
# Package version to publish | |
version: ${{ env.cleanVersion }} # This is the tag that was created in the release but without the leading 'v' | |
# Description of the mod | |
description: mp_s2s but space | |
# Thunderstore API token | |
token: ${{ secrets.TS_KEY }} | |
# Directory to wrap the contents of the repo in | |
wrap: mods/${{ github.repository_owner }}.${{ env.name }} # This will wrap your Author.ModName folder in a mods/ folder before publishing |