added autopause #33
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: verify & release | |
on: | |
push: | |
branches: | |
- master | |
defaults: | |
run: | |
shell: nu {0} | |
permissions: | |
contents: write | |
jobs: | |
verify-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: hustcer/[email protected] | |
- run: try { git fetch --depth=1 origin +refs/tags/*:refs/tags/* } | |
- name: Pack | |
id: pack | |
run: | | |
./packwiz refresh | |
./packwiz modrinth export | |
$"version=(open ./pack.toml | get version)(char nl)" out>> $env.GITHUB_OUTPUT | |
$"mc-version=(open ./pack.toml | get versions.minecraft)(char nl)" out>> $env.GITHUB_OUTPUT | |
- name: Output | |
env: | |
version: ${{ steps.pack.outputs.version }} | |
mc_version: ${{ steps.pack.outputs.mc-version }} | |
run: | | |
print $"Version: ($env.version)" | |
print $"Minecraft version: ($env.mc_version)" | |
- uses: tj-actions/verify-changed-files@v18 | |
with: | |
fail-if-changed: true | |
- name: Autotag | |
id: autotag | |
env: | |
version: ${{ steps.pack.outputs.version }} | |
run: | | |
let version = $"v($env.version)" | |
let untagged = (git tag -l | lines -s | find $version | is-empty) | |
if $untagged { | |
print $"pushing tag ($version)" | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email '[email protected]' | |
git tag $version | |
git push origin $version | |
} else { | |
print "version already tagged" | |
} | |
$"created-tag=($untagged)(char nl)" out>> $env.GITHUB_OUTPUT | |
- uses: softprops/action-gh-release@v1 | |
if: ${{ steps.autotag.outputs.created-tag == 'true' }} | |
with: | |
files: '*.mrpack' | |
tag_name: v${{ steps.pack.outputs.version }} | |
draft: true | |
- uses: Kir-Antipov/[email protected] | |
if: ${{ steps.autotag.outputs.created-tag == 'true' }} | |
with: | |
name: | | |
Liz's Limited Liability | |
version: ${{ steps.pack.outputs.version }} | |
game-versions: ${{ steps.pack.outputs.mc-version }} | |
modrinth-id: ${{ secrets.MODRINTH_ID }} | |
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | |
modrinth-unfeature-mode: any | |
version-type: beta | |
loaders: quilt | |
files: '*.mrpack' |