Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mfoltz authored Aug 29, 2024
1 parent 0893368 commit edc23e7
Showing 1 changed file with 7 additions and 27 deletions.
34 changes: 7 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Release

on:
release:
types: [published]
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -31,35 +29,17 @@ jobs:
run: echo "RELEASE_TAG=${{ env.latest_tag }}" >> $GITHUB_ENV

- name: Download Release
run: gh release download ${{ env.RELEASE_TAG }} -D ./dist
run: |
gh release download ${{ env.RELEASE_TAG }} -D ./dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install Thunderstore CLI (tcli)
run: dotnet tool install --global tcli

- name: Extract Namespace from thunderstore.toml
id: extract_namespace
run: |
namespace=$(grep 'team =' thunderstore.toml | sed 's/team = "\(.*\)"/\1/')
echo "namespace=$namespace" >> $GITHUB_ENV
shell: bash

- name: Extract Package Name from manifest.json
id: extract_package_name
run: |
name=$(jq -r .name manifest.json)
echo "name=$name" >> $GITHUB_ENV
shell: bash

- name: Prepare Thunderstore Package
run: |
version=${{ env.RELEASE_TAG:1 }}
mkdir -p ./dist/package
cp Eclipse.dll manifest.json CHANGELOG.md README.md icon.png ./dist/package/
cd ./dist/package
zip -r ../zfolmt-Eclipse-$version.zip .
shell: bash

- name: Publish build to Thunderstore
run: tcli publish --token ${{ secrets.THUNDERSTORE_KEY }} --package-version ${{ env.RELEASE_TAG:1 }} --team ${{ env.namespace }} --package ${{ env.name }} --config ./dist/thunderstore.toml
run: |
trimmed_tag=${RELEASE_TAG:1}
tcli publish --token ${{ secrets.THUNDERSTORE_KEY }} --package-version $trimmed_tag
env:
RELEASE_TAG: ${{ env.RELEASE_TAG }}

0 comments on commit edc23e7

Please sign in to comment.