diff --git a/.asset-template.json.hb b/.github/workflows/.asset-template-addons.json.hb similarity index 91% rename from .asset-template.json.hb rename to .github/workflows/.asset-template-addons.json.hb index 2302fcdd..548accb1 100644 --- a/.asset-template.json.hb +++ b/.github/workflows/.asset-template-addons.json.hb @@ -3,7 +3,7 @@ "description": "Modular inventory system for godot 4 with nodes, compatible with multiplayer, separate logic from the UI, Using items as separate resources.\nDemos: https://godotengine.org/asset-library/asset/1895", "category_id": "6", "godot_version": "4.1", - "version_string": "{{ context.release.tag_name }}", + "version_string": "{{ env.PLUGIN_VERSION }}", "cost": "MIT", "download_provider": "GitHub", "download_commit": "{{ env.GITHUB_SHA }}", diff --git a/.github/workflows/.asset-template-demos.json.hb b/.github/workflows/.asset-template-demos.json.hb new file mode 100644 index 00000000..fedbb552 --- /dev/null +++ b/.github/workflows/.asset-template-demos.json.hb @@ -0,0 +1,13 @@ +{ + "title": "Inventory System Demos", + "description": "This project contains demos of the inventory-system addon: https://godotengine.org/asset-library/asset/1650", + "category_id": "10", + "godot_version": "4.1", + "version_string": "{{ env.PLUGIN_VERSION }}", + "cost": "MIT", + "download_provider": "GitHub", + "download_commit": "{{ env.GITHUB_SHA }}", + "browse_url": "{{ context.repository.html_url }}", + "issues_url": "{{ context.repository.html_url }}/issues", + "icon_url": "https://raw.githubusercontent.com/expressobits/inventory-system/addon/icon.png" +} \ No newline at end of file diff --git a/.github/workflows/push_to_asset_lib.yml b/.github/workflows/push_addon_to_asset_lib.yml similarity index 56% rename from .github/workflows/push_to_asset_lib.yml rename to .github/workflows/push_addon_to_asset_lib.yml index 41eb0f6e..a737220c 100644 --- a/.github/workflows/push_to_asset_lib.yml +++ b/.github/workflows/push_addon_to_asset_lib.yml @@ -1,18 +1,35 @@ -name: "Push to asset lib" -on: +name: "Push Addon To Asset Lib" +on: + workflow_dispatch: + inputs: + plugin_version: + description: 'Plugin version number:' + required: true + type: string + default: '1.0.0' push: branches: [ addon ] +env: + PLUGIN_VERSION: 0.0.1 + jobs: + publish: + # needs: [env-setup] runs-on: ubuntu-latest name: Publish new version to asset lib steps: - - name: Checkout uses: actions/checkout@v3 + - name: set_plugin_version + id: set_plugin_version + run: | + VERSION=$(grep version addons/inventory-system/plugin.cfg | cut -d "=" -f 2 | tr -d '"') + echo "PLUGIN_VERSION=${VERSION}" >> $GITHUB_ENV + - name: Godot Asset Lib # You may pin to the exact commit or the version. # uses: deep-entertainment/godot-asset-lib-action@81addbb4db62199a69e4aa5535741a8928d6abb6 @@ -26,6 +43,9 @@ jobs: # ID of the asset in the asset store assetId: 1650 # Path to asset template file - assetTemplate: .asset-template.json.hb + assetTemplate: .github/workflows/.asset-template-addons.json.hb # Godot asset lib base url baseUrl: https://godotengine.org/asset-library/api + + - name: Debug Godot Asset Lib + run: echo $PLUGIN_VERSION diff --git a/.github/workflows/push_demos_to_asset_lib.yml b/.github/workflows/push_demos_to_asset_lib.yml new file mode 100644 index 00000000..b1cd3ab4 --- /dev/null +++ b/.github/workflows/push_demos_to_asset_lib.yml @@ -0,0 +1,51 @@ +name: "Push Demos To Asset Lib" +on: + workflow_dispatch: + inputs: + plugin_version: + description: 'Plugin version number:' + required: true + type: string + default: '1.0.0' + push: + branches: [ demos ] + +env: + PLUGIN_VERSION: 0.0.1 + +jobs: + + publish: + # needs: [env-setup] + runs-on: ubuntu-latest + name: Publish new version to asset lib + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: set_plugin_version + id: set_plugin_version + run: | + VERSION=$(grep version addons/inventory-system/plugin.cfg | cut -d "=" -f 2 | tr -d '"') + echo "PLUGIN_VERSION=${VERSION}" >> $GITHUB_ENV + + - name: Godot Asset Lib + # You may pin to the exact commit or the version. + # uses: deep-entertainment/godot-asset-lib-action@81addbb4db62199a69e4aa5535741a8928d6abb6 + uses: deep-entertainment/godot-asset-lib-action@v0.4.0 + with: + action: addEdit + # Godot asset lib username + username: expressobits + # Godot asset lib password + password: ${{ secrets.GODOT_ASSET_LIB_PASSWORD }} + # ID of the asset in the asset store + assetId: 1650 + # Path to asset template file + assetTemplate: .github/workflows/.asset-template-demos.json.hb + # Godot asset lib base url + baseUrl: https://godotengine.org/asset-library/api + + - name: Debug Godot Asset Lib + run: echo $PLUGIN_VERSION