-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (46 loc) · 2.01 KB
/
regenerate_tidalapi_module.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
58
59
60
name: Download Asset from Another Repo's Release
on:
push:
workflow_dispatch: # This workflow is manually triggered
jobs:
download-asset:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the current repository (optional)
- name: Checkout Repository
uses: actions/checkout@v3
# Step 2: Get the latest release information from another repository
- name: Get Release Info from Another Repo
id: get_release
run: |
REPO_OWNER="tidal-music"
REPO_NAME="openapi-generator"
# Fetch the latest release information
curl -s -H -v "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/releases/latest" > release_info.json
cat release_info.json
# Extract the download URL for the desired asset (example: 'my-asset.zip')
ASSET_ID=$(jq -r '.assets[] | select(.name == "openapi-generator-cli.jar") | .id' release_info.json)
ASSET_URL=$(jq -r '.assets[] | select(.name == "openapi-generator-cli.jar") | .browser_download_url' release_info.json)
echo "Asset URL: $ASSET_ID"
# Save asset URL for the next step
echo "::set-output name=asset_id::$ASSET_URL"
# Step 3: Download the asset from the release
- name: Download Asset
run: |
REPO_OWNER="organization"
REPO_NAME="another-repo"
ASSET_ID=${{ steps.get_release.outputs.asset_id }}
# Download the asset using the GitHub API
curl -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/octet-stream" \
-o tidalapi/bin/openapi-generator-cli.jar \
"$ASSET_ID"
- name: List Files
run: ls -l
- name: Regenerate the TidalAPI module
run: |
cd tidalapi
python ./bin/generate-api-files.py ./bin/generate-api-config.json
env:
JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64