This repository has been archived by the owner on Oct 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (48 loc) · 2.04 KB
/
ImperialPlugins.PushRelease.Rocket.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Imperial Plugins Push Release (Rocket)
on:
release:
types: [published]
jobs:
build:
name: Imperial Plugins Upload (Rocket)
runs-on: self-hosted
env:
PRODUCT_ID: "349" # Must change per each plugin's workflow
PLUGIN_NAME: "${{ github.event.repository.name }}"
VERSION: "${{ github.event.release.tag_name }}"
PRODUCT_BRANCH: "rocketmod"
RELEASE_DESCRIPTION: "${{ github.event.release.body }}"
ASSET_FILE_NAME: "${{ github.event.repository.name }}-Rocket-v${{ github.event.release.tag_name }}.zip"
IP_API_KEY: "${{ secrets.IMPERIALPLUGINS_API_KEY }}"
IP_API_URL: "https://api.imperialplugins.com/v2/Products/Files"
steps:
- name: Install jo
run: sudo apt-get install jo
- name: Write Description File
uses: DamianReeves/[email protected]
with:
path: description.txt
contents: "${{ env.RELEASE_DESCRIPTION }}"
write-mode: overwrite
- name: Download Rocket Release
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: "${{ github.event.repository.full_name }}"
version: "tags/${{ env.VERSION }}"
file: "${{ env.ASSET_FILE_NAME }}"
target: "${{ env.ASSET_FILE_NAME }}"
token: "${{ secrets.GITHUB_TOKEN }}"
- name: Build Post File
run: |
jo [email protected] \
displayVersion="${{ env.VERSION }}" \
forceUpdate=false \
file[fileName]="${{ env.ASSET_FILE_NAME }}" \
file[base64]="%${{ env.ASSET_FILE_NAME }}" \
productBranchIdentifier="${{ env.PRODUCT_BRANCH }}" \
productId=${{ env.PRODUCT_ID }} > postdata.txt
sed -i "s/base64\":\"/base64\":\"data:application\/x-zip-compressed;base64,/" postdata.txt
shell: bash
- name: Push Release File to Imperial Plugins
run: "curl -X POST \"${{ env.IP_API_URL }}\" -H \"accept: */*\" -H \"Content-Type: application/json\" -H \"X-API-KEY: ${{ env.IP_API_KEY }}\" -d @postdata.txt"
shell: bash