11name : Release Common
2+ run-name : Release common ${{ github.ref_name }} by @${{ github.actor }}
23
34on :
45 push :
910
1011permissions :
1112 contents : write
13+ actions : read
1214
1315jobs :
1416 release :
@@ -25,14 +27,22 @@ jobs:
2527 with :
2628 fetch-depth : 0
2729
28- - name : 2️⃣ Configure GitHub auth and identity
30+ - name : 2️⃣ Create ianhub-agent token
31+ id : app-token
32+ uses : actions/create-github-app-token@v2
33+ with :
34+ app-id : ${{ secrets.IANHUB_AGENT_APP_ID }}
35+ private-key : ${{ secrets.IANHUB_AGENT_PRIVATE_KEY }}
36+ owner : ianhubnet
37+
38+ - name : 3️⃣ Configure GitHub auth and identity
2939 shell : bash
3040 run : |
31- git config --global url."https://${{ secrets.CSK_PAT }}@github.com/".insteadOf "https://github.com/"
32- git config user.name "ianhub-bot"
33- git config user.email "bot@ianhub.net "
41+ git config --global url."https://x-access-token: ${{ steps.app-token.outputs.token }}@github.com/".insteadOf "https://github.com/"
42+ git config --global user.name "ianhub-agent[ bot] "
43+ git config --global user.email "ianhub-agent[ bot]@users.noreply.github.com "
3444
35- - name : 3️⃣ Set up variables
45+ - name : 4️⃣ Set up variables
3646 id : vars
3747 shell : bash
3848 run : |
4151 echo "tag=$TAG" >> $GITHUB_OUTPUT
4252 echo "zip=$ZIP" >> $GITHUB_OUTPUT
4353
44- - name : 4️⃣ Prepare ZIP contents
54+ - name : 5️⃣ Prepare ZIP contents
4555 shell : bash
4656 run : |
4757 if [ ! -d "src" ]; then
@@ -52,31 +62,41 @@ jobs:
5262 mkdir "common"
5363 cp -r src/* "common/"
5464
55- - name : 5️⃣ Create ZIP archive
65+ - name : 6️⃣ Create ZIP archive
5666 shell : bash
5767 run : |
5868 zip -r "${{ steps.vars.outputs.zip }}" "common"
5969
60- - name : 6️⃣ Create GitHub Release and upload ZIP
70+ - name : 7️⃣ Create GitHub Release and upload ZIP
6171 uses : softprops/action-gh-release@v3
6272 with :
6373 tag_name : ${{ steps.vars.outputs.tag }}
6474 files : ${{ steps.vars.outputs.zip }}
75+ env :
76+ GITHUB_TOKEN : ${{ steps.app-token.outputs.token }}
6577
6678 post-release :
6779 name : Upload Common ZIP to FTP
6880 needs : release
6981 runs-on : ubuntu-latest
7082
7183 steps :
72- - name : 1️⃣ Download release ZIP
84+ - name : 1️⃣ Create ianhub-agent token
85+ id : app-token
86+ uses : actions/create-github-app-token@v2
87+ with :
88+ app-id : ${{ secrets.IANHUB_AGENT_APP_ID }}
89+ private-key : ${{ secrets.IANHUB_AGENT_PRIVATE_KEY }}
90+ owner : ianhubnet
91+
92+ - name : 2️⃣ Download release ZIP
7393 shell : bash
7494 run : |
7595 REPO="${{ needs.release.outputs.repo }}"
7696 API_URL="https://api.github.com/repos/$REPO/releases/latest"
7797
7898 echo "🔍 Fetching release info..."
79- curl -s -H "Authorization: token ${{ secrets.CSK_PAT }}" "$API_URL" > release.json
99+ curl -s -H "Authorization: Bearer ${{ steps.app-token.outputs.token }}" "$API_URL" > release.json
80100
81101 ZIP_URL=$(jq -r '.assets[] | select(.name | endswith(".zip")) | .browser_download_url' release.json)
82102
87107
88108 curl -L -o common.zip "$ZIP_URL"
89109
90- - name : 2️⃣ Upload common.zip to FTP
91- uses : SamKirkland/FTP-Deploy-Action@4.3.3
110+ - name : 3️⃣ Upload common.zip to FTP
111+ uses : SamKirkland/FTP-Deploy-Action@4.3.5
92112 with :
93113 server : ${{ secrets.FTP_HOST }}
94114 port : ${{ secrets.FTP_PORT }}
@@ -101,7 +121,7 @@ jobs:
101121 **/*
102122 !common.zip
103123
104- - name : 3️⃣ Send JSON-RPC
124+ - name : 4️⃣ Send JSON-RPC
105125 shell : bash
106126 env :
107127 RPC_URL : ${{ secrets.RPC_URL }}
0 commit comments