|
1 | | -name: Push Firmware to Universal-Flasher |
| 1 | +# name: Push Firmware to Universal-Flasher |
2 | 2 |
|
3 | | -on: |
4 | | - release: |
5 | | - types: [published, edited] |
| 3 | +# on: |
| 4 | +# release: |
| 5 | +# types: [published, edited] |
6 | 6 |
|
7 | | -env: |
8 | | - TARGET_DIR: BLLED |
| 7 | +# env: |
| 8 | +# TARGET_DIR: BLLED |
9 | 9 |
|
10 | | -jobs: |
11 | | - push-firmware: |
12 | | - runs-on: ubuntu-latest |
| 10 | +# jobs: |
| 11 | +# push-firmware: |
| 12 | +# runs-on: ubuntu-latest |
13 | 13 |
|
14 | | - steps: |
15 | | - - name: Checkout this firmware repo |
16 | | - uses: actions/checkout@v3 |
| 14 | +# steps: |
| 15 | +# - name: Checkout this firmware repo |
| 16 | +# uses: actions/checkout@v3 |
17 | 17 |
|
18 | | - - name: Download .bin from current release |
19 | | - uses: actions/github-script@v6 |
20 | | - env: |
21 | | - TARGET_DIR: ${{ env.TARGET_DIR }} |
22 | | - with: |
23 | | - github-token: ${{ secrets.GITHUB_TOKEN }} |
24 | | - script: | |
25 | | - const fs = require('fs'); |
26 | | - const path = require('path'); |
| 18 | +# - name: Download .bin from current release |
| 19 | +# uses: actions/github-script@v6 |
| 20 | +# env: |
| 21 | +# TARGET_DIR: ${{ env.TARGET_DIR }} |
| 22 | +# with: |
| 23 | +# github-token: ${{ secrets.GITHUB_TOKEN }} |
| 24 | +# script: | |
| 25 | +# const fs = require('fs'); |
| 26 | +# const path = require('path'); |
27 | 27 |
|
28 | | - const owner = context.repo.owner; |
29 | | - const repo = context.repo.repo; |
30 | | - const release = context.payload.release; |
31 | | - const assets = release.assets.filter(a => a.name.endsWith('.bin')); |
| 28 | +# const owner = context.repo.owner; |
| 29 | +# const repo = context.repo.repo; |
| 30 | +# const release = context.payload.release; |
| 31 | +# const assets = release.assets.filter(a => a.name.endsWith('.bin')); |
32 | 32 |
|
33 | | - if (assets.length === 0) { |
34 | | - core.setFailed("❌ No .bin files found in release"); |
35 | | - return; |
36 | | - } |
| 33 | +# if (assets.length === 0) { |
| 34 | +# core.setFailed("❌ No .bin files found in release"); |
| 35 | +# return; |
| 36 | +# } |
37 | 37 |
|
38 | | - const targetDir = path.join('firmware', process.env.TARGET_DIR); |
39 | | - fs.mkdirSync(targetDir, { recursive: true }); |
| 38 | +# const targetDir = path.join('firmware', process.env.TARGET_DIR); |
| 39 | +# fs.mkdirSync(targetDir, { recursive: true }); |
40 | 40 |
|
41 | | - for (const asset of assets) { |
42 | | - const dl = await github.rest.repos.getReleaseAsset({ |
43 | | - owner, |
44 | | - repo, |
45 | | - asset_id: asset.id, |
46 | | - headers: { Accept: 'application/octet-stream' } |
47 | | - }); |
| 41 | +# for (const asset of assets) { |
| 42 | +# const dl = await github.rest.repos.getReleaseAsset({ |
| 43 | +# owner, |
| 44 | +# repo, |
| 45 | +# asset_id: asset.id, |
| 46 | +# headers: { Accept: 'application/octet-stream' } |
| 47 | +# }); |
48 | 48 |
|
49 | | - const filePath = path.join(targetDir, asset.name); |
50 | | - fs.writeFileSync(filePath, Buffer.from(dl.data)); |
51 | | - console.log(`✅ Downloaded: ${filePath}`); |
52 | | - } |
| 49 | +# const filePath = path.join(targetDir, asset.name); |
| 50 | +# fs.writeFileSync(filePath, Buffer.from(dl.data)); |
| 51 | +# console.log(`✅ Downloaded: ${filePath}`); |
| 52 | +# } |
53 | 53 |
|
54 | | - - name: Clone BLLED-Flasher repo |
55 | | - run: | |
56 | | - git clone https://x-access-token:${{ secrets.BLLED_FLASHER_TOKEN }}@github.com/DutchDevelop/blledsetup.git flasher |
| 54 | +# - name: Clone BLLED-Flasher repo |
| 55 | +# run: | |
| 56 | +# git clone https://x-access-token:${{ secrets.BLLED_FLASHER_TOKEN }}@github.com/DutchDevelop/blledsetup.git flasher |
57 | 57 |
|
58 | | - - name: Copy firmware to Flasher repo |
59 | | - run: | |
60 | | - mkdir -p flasher/firmware/${{ env.TARGET_DIR }} |
61 | | - cp -r firmware/${{ env.TARGET_DIR }}/* flasher/firmware/${{ env.TARGET_DIR }}/ |
| 58 | +# - name: Copy firmware to Flasher repo |
| 59 | +# run: | |
| 60 | +# mkdir -p flasher/firmware/${{ env.TARGET_DIR }} |
| 61 | +# cp -r firmware/${{ env.TARGET_DIR }}/* flasher/firmware/${{ env.TARGET_DIR }}/ |
62 | 62 |
|
63 | | - - name: Generate manifests and firmware.json |
64 | | - run: | |
65 | | - cd flasher |
66 | | - node generateRelease.js |
| 63 | +# - name: Generate manifests and firmware.json |
| 64 | +# run: | |
| 65 | +# cd flasher |
| 66 | +# node generateRelease.js |
67 | 67 |
|
68 | | - - name: Commit and Push to BLLED-Flasher |
69 | | - run: | |
70 | | - cd flasher |
71 | | - git config user.name "BLLED Release Bot" |
72 | | - git config user.email "actions@github.com" |
73 | | - git fetch origin |
74 | | - git add firmware/ |
75 | | - if git diff --cached --quiet; then |
76 | | - echo "✅ No changes to commit." |
77 | | - else |
78 | | - git commit -m "📦 Add firmware from release ${{ github.event.release.tag_name }} into ${{ env.TARGET_DIR }}" |
79 | | - git push |
80 | | - fi |
| 68 | +# - name: Commit and Push to BLLED-Flasher |
| 69 | +# run: | |
| 70 | +# cd flasher |
| 71 | +# git config user.name "BLLED Release Bot" |
| 72 | +# git config user.email "actions@github.com" |
| 73 | +# git fetch origin |
| 74 | +# git add firmware/ |
| 75 | +# if git diff --cached --quiet; then |
| 76 | +# echo "✅ No changes to commit." |
| 77 | +# else |
| 78 | +# git commit -m "📦 Add firmware from release ${{ github.event.release.tag_name }} into ${{ env.TARGET_DIR }}" |
| 79 | +# git push |
| 80 | +# fi |
0 commit comments