155 lines
4.6 KiB
YAML
155 lines
4.6 KiB
YAML
name: Push release data
|
|
|
|
env:
|
|
strapi_download_url: 'https://strapi.feat-nym-update-nym-web.websites.dev.nymte.ch/api/downloaders'
|
|
strapi_updater_url: 'https://strapi.feat-nym-update-nym-web.websites.dev.nymte.ch/api/updaters'
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs: &wf-inputs
|
|
release_tag:
|
|
required: true
|
|
description: Release tag
|
|
type: string
|
|
release_id:
|
|
required: true
|
|
description: Release ID
|
|
type: string
|
|
release_date:
|
|
required: true
|
|
description: Release date
|
|
type: string
|
|
download_base_url:
|
|
required: true
|
|
description: Download base URL
|
|
type: string
|
|
changelog_url:
|
|
required: true
|
|
description: Changelog URL
|
|
type: string
|
|
archive_url:
|
|
required: false
|
|
description: Binary archive URL
|
|
type: string
|
|
sig_url:
|
|
required: false
|
|
description: Archive signature URL
|
|
type: string
|
|
version:
|
|
required: true
|
|
description: Release version (semver)
|
|
type: string
|
|
filename:
|
|
required: true
|
|
description: Binary file name
|
|
type: string
|
|
file_hash:
|
|
required: true
|
|
description: Binary hash (sha256)
|
|
type: string
|
|
name:
|
|
required: true
|
|
description: Name
|
|
type: string
|
|
category:
|
|
required: true
|
|
description: Category
|
|
type: string
|
|
platform:
|
|
required: false
|
|
description: Platform
|
|
type: string
|
|
workflow_dispatch:
|
|
inputs:
|
|
<<: *wf-inputs
|
|
category:
|
|
required: true
|
|
description: Category
|
|
default: 'wallet'
|
|
type: choice
|
|
options:
|
|
- wallet
|
|
- connect
|
|
- binaries
|
|
platform:
|
|
required: false
|
|
description: Platform
|
|
default: 'Ubuntu'
|
|
type: choice
|
|
options:
|
|
- Ubuntu
|
|
- Windows
|
|
- MacOS
|
|
|
|
jobs:
|
|
push-download-data:
|
|
name: Push download data to Strapi
|
|
runs-on: custom-runner-linux
|
|
|
|
steps:
|
|
- id: get_sig
|
|
name: Get sig
|
|
if: ${{ inputs.sig_url != null }}
|
|
run: |
|
|
output=$(curl -LsSf ${{ inputs.sig_url }})
|
|
echo "sig=$output" >> "$GITHUB_OUTPUT"
|
|
- name: Push download data
|
|
uses: fjogeleit/http-request-action@v1
|
|
with:
|
|
url: ${{ env.strapi_download_url }}
|
|
method: 'POST'
|
|
# bearerToken: ${{ secrets.STRAPI_AUTH_TOKEN }} TODO
|
|
customHeaders: '{"Content-Type": "application/json"}'
|
|
data: |
|
|
{
|
|
"data": {
|
|
"releaseId": "${{ inputs.release_id }}",
|
|
"releaseDate": "${{ inputs.release_date }}",
|
|
"downloadBaseUrl": "${{ inputs.download_base_url }}",
|
|
"changelogUrl": "${{ inputs.changelog_url }}",
|
|
"version": "${{ inputs.version }}",
|
|
"filename": "${{ inputs.filename }}",
|
|
"name": "${{ inputs.name }}",
|
|
"category": "${{ inputs.category }}",
|
|
"platform": "${{ inputs.platform }}",
|
|
"sha256": "${{ inputs.file_hash }}",
|
|
"sig": "${{ steps.get_sig.outputs.sig }}"
|
|
}
|
|
}
|
|
|
|
push-update-data:
|
|
name: Push update data to Strapi
|
|
runs-on: ${{ matrix.platform }}
|
|
# only push update data for tauri apps (desktop wallet and NC)
|
|
if: ${{ inputs.category == 'wallet' || inputs.category == 'connect' }}
|
|
|
|
steps:
|
|
- id: get_sig
|
|
name: Get sig
|
|
if: ${{ inputs.sig_url != null }}
|
|
run: |
|
|
output=$(curl -LsSf ${{ inputs.sig_url }})
|
|
echo "sig=$output" >> "$GITHUB_OUTPUT"
|
|
- name: Push update data
|
|
uses: fjogeleit/http-request-action@v1
|
|
with:
|
|
url: ${{ env.strapi_updater_url }}
|
|
method: 'POST'
|
|
# bearerToken: ${{ secrets.STRAPI_AUTH_TOKEN }} TODO
|
|
customHeaders: '{"Content-Type": "application/json"}'
|
|
data: |
|
|
{
|
|
"data": {
|
|
"releaseId": "${{ inputs.release_id }}",
|
|
"releaseDate": "${{ inputs.release_date }}",
|
|
"downloadUrl": "${{ inputs.archive_url }}",
|
|
"changelog": "See ${{ inputs.changelog_url }} for the changelog",
|
|
"version": "${{ inputs.version }}",
|
|
"filename": "${{ inputs.filename }}",
|
|
"category": "${{ inputs.category }}",
|
|
"platform": "${{ inputs.platform }}",
|
|
"sha256": "${{ inputs.file_hash }}",
|
|
"sig": "${{ steps.get_sig.outputs.sig }}"
|
|
}
|
|
}
|