Skip to content

Commit

Permalink
Merge pull request #5 from SGG-Modding/h2ts
Browse files Browse the repository at this point in the history
restructure for hades 2 thunderstore
  • Loading branch information
AndreLouisIssa authored Apr 24, 2024
2 parents 7807e5c + d3e40cd commit 40f4d2e
Show file tree
Hide file tree
Showing 11 changed files with 156 additions and 2 deletions.
105 changes: 105 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Publish

on:
workflow_dispatch:
inputs:
tag:
description: "Tag / Version number (leave empty for dry-run)"
required: false

env:
changelog: CHANGELOG.md
thunderstore-config: thunderstore.toml
build-dir: build/
artifacts-content-type: application/zip

jobs:
tag-and-release:
name: Rotate version, tag, and create release
runs-on: ubuntu-latest
if: github.event.inputs.tag
outputs:
upload_url: ${{ steps.release.outputs.upload_url }}
steps:
- name: Check input tag format
run: |
echo "${{ github.event.inputs.tag }}" | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$'
- name: Checkout files
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f

- name: Rotate unreleased section in changelog
uses: thomaseizinger/keep-a-changelog-new-release@77ac767b2f7f6edf2ee72ab3364ed26667086f96
with:
tag: ${{ github.event.inputs.tag }}

- name: Rotate version in Thunderstore CLI config
run: |
sed -i 's/versionNumber = ".*"/versionNumber = "${{ github.event.inputs.tag }}"/' ${{ env.thunderstore-config }}
- name: Push updated files to repository and tag
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add ${{ env.changelog }} ${{ env.thunderstore-config }}
git commit --message "Release ${{ github.event.inputs.tag }}"
git tag ${{ github.event.inputs.tag }}
git push origin HEAD:${{ github.ref_name }} --tags
- name: Create release
id: release
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e
with:
release_name: ${{ github.event.inputs.tag }}
tag_name: ${{ github.event.inputs.tag }}
commitish: ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-and-publish-package:
name: Build and publish package
needs: tag-and-release
if: always() && (needs.tag-and-release.result == 'success' || needs.tag-and-release.result == 'skipped')
runs-on: ubuntu-latest
steps:
- name: Checkout files
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f
with:
ref: ${{ github.event.inputs.tag || github.sha }}
lfs: true

- name: Install Thunderstore CLI
run: dotnet tool install -g tcli

- name: Build package
if: ${{ !needs.tag-and-release.outputs.upload_url }}
run: tcli build

- name: Publish package
if: needs.tag-and-release.outputs.upload_url
env:
TCLI_AUTH_TOKEN: ${{ secrets.TCLI_AUTH_TOKEN }}
run: tcli publish

- name: Retrieve package name
run: |
ARTIFACTS_NAME=$(find "${{ env.build-dir }}" -type f -printf "%f\n")
echo "artifacts-name=${ARTIFACTS_NAME}" >> "$GITHUB_ENV"
- name: Upload artifacts to workflow
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
with:
name: ${{ env.artifacts-name }}
path: ${{ env.build-dir }}/${{ env.artifacts-name }}
retention-days: 1

- name: Upload artifacts to release
if: needs.tag-and-release.outputs.upload_url
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
with:
upload_url: ${{ needs.tag-and-release.outputs.upload_url }}
asset_path: ${{ env.build-dir }}/${{ env.artifacts-name }}
asset_name: ${{ env.artifacts-name }}
asset_content_type: ${{ env.artifacts-content-type }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.10.0]

### Added

- Initial Thunderstore release.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Mod Utility / ModUtil
Utility mod for mod interactions within sgg games
see the [Wiki](https://github.com/SGG-Modding/sgg-mod-modutil/wiki) for more details
Utility mod for mod interactions within lua for SGG's games
see the [Wiki](https://github.com/SGG-Modding/ModUtil/wiki) for more details
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 37 additions & 0 deletions thunderstore.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[config]
schemaVersion = "0.0.1"

[package]
namespace = "SGG_Modding"
name = "ModUtil"
versionNumber = "2.10.0"
description = "Utility mod for mod interactions within lua for for SGG's games"
websiteUrl = "https://github.com/SGG-Modding/ModUtil"
containsNsfwContent = false

[package.dependencies]

[build]
icon = "./icon.png"
readme = "./README.md"
outdir = "./build"

[[build.copy]]
source = "./CHANGELOG.md"
target = "./CHANGELOG.md"

[[build.copy]]
source = "./LICENSE"
target = "./LICENSE"

[[build.copy]]
source = "./src"
target = "./"


[publish]
repository = "https://thunderstore.io"
communities = [ "hades-ii", ]

[publish.categories]
hades-ii = [ "libraries", "mods" ]

0 comments on commit 40f4d2e

Please sign in to comment.