@@ -35,32 +35,32 @@ jobs:
3535
3636 - name : Set up Docker Buildx
3737 uses : docker/setup-buildx-action@v3
38- # - name: Login to Docker Hub
39- # uses: docker/login-action@v3
40- # with:
41- # username: ${{ secrets.DOCKERHUB_USERNAME }}
42- # password: ${{ secrets.DOCKERHUB_TOKEN }}
43- # - name: Build and push docker development image
44- # if: github.ref == 'refs/heads/dev'
45- # uses: docker/build-push-action@v6
46- # with:
47- # context: ./endpoint
48- # platforms: linux/amd64,linux/arm64
49- # push: true
50- # file: ./endpoint/Dockerfile_dev
51- # tags: christld/macless-haystack:latest-dev,christld/macless-haystack:v${{ env.VERSION }}-${{ github.sha }},
52- # - name: Build and push docker main image
53- # if: github.ref == 'refs/heads/main'
54- # uses: docker/build-push-action@v5
55- # with:
56- # context: "{{defaultContext}}:endpoint"
57- # platforms: linux/amd64,linux/arm64
58- # push: true
59- # tags: christld/macless-haystack:latest,christld/macless-haystack:v${{ env.VERSION }},
60- # - name: Install ARM Toolchain
61- # uses: carlosperate/arm-none-eabi-gcc-action@v1
62- # with:
63- # release: '10-2020-q4'
38+ - name : Login to Docker Hub
39+ uses : docker/login-action@v3
40+ with :
41+ username : ${{ secrets.DOCKERHUB_USERNAME }}
42+ password : ${{ secrets.DOCKERHUB_TOKEN }}
43+ - name : Build and push docker development image
44+ if : github.ref == 'refs/heads/dev'
45+ uses : docker/build-push-action@v6
46+ with :
47+ context : ./endpoint
48+ platforms : linux/amd64,linux/arm64
49+ push : true
50+ file : ./endpoint/Dockerfile_dev
51+ tags : christld/macless-haystack:latest-dev,christld/macless-haystack:v${{ env.VERSION }}-${{ github.sha }},
52+ - name : Build and push docker main image
53+ if : github.ref == 'refs/heads/main'
54+ uses : docker/build-push-action@v5
55+ with :
56+ context : " {{defaultContext}}:endpoint"
57+ platforms : linux/amd64,linux/arm64
58+ push : true
59+ tags : christld/macless-haystack:latest,christld/macless-haystack:v${{ env.VERSION }},
60+ - name : Install ARM Toolchain
61+ uses : carlosperate/arm-none-eabi-gcc-action@v1
62+ with :
63+ release : ' 10-2020-q4'
6464
6565 - uses : actions/setup-java@v3
6666 with :
6969 cache : ' gradle'
7070 - uses : subosito/flutter-action@v2
7171 with :
72- cache : false
72+ cache : true
7373 channel : stable
7474 - name : Cache Flutter for Android Build
7575 uses : actions/cache@v5
@@ -92,11 +92,11 @@ jobs:
9292 flutter test
9393 flutter build apk --release --build-name=${{ env.VERSION }}
9494 mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/android-application.apk
95- # - name: Upload Android Artifacts
96- # uses: actions/upload-artifact@v6
97- # with:
98- # name: android-application
99- # path: ./macless_haystack/build/app/outputs/flutter-apk/android-application.apk
95+ - name : Upload Android Artifacts
96+ uses : actions/upload-artifact@v6
97+ with :
98+ name : android-application
99+ path : ./macless_haystack/build/app/outputs/flutter-apk/android-application.apk
100100 - name : Cache Flutter Web Build
101101 uses : actions/cache@v5
102102 id : flutter-web-cache
@@ -115,31 +115,30 @@ jobs:
115115 flutter pub get
116116 fi
117117 flutter build web --profile --base-href "/macless-haystack/"
118- # - name: Deploy to Github Pages
119- # if: github.ref == 'refs/heads/dev'
120- # uses: JamesIves/github-pages-deploy-action@v4
121- # with:
122- # folder: ./macless_haystack/build/web
123- #
118+ - name : Deploy to Github Pages
119+ if : github.ref == 'refs/heads/dev'
120+ uses : JamesIves/github-pages-deploy-action@v4
121+ with :
122+ folder : ./macless_haystack/build/web
123+
124124 - name : Web Build
125125 working-directory : ./macless_haystack
126126 run : |
127127 if [ "${{ steps.flutter-web-cache.outputs.cache-hit }}" != "true" ]; then
128128 flutter pub get
129129 fi
130130 flutter build web --release
131- # - name: Copy files to web application
132- # run: |
133- # mkdir -p ./macless_haystack/build/webapplication
134- # cp -R ./macless_haystack/build/web ./macless_haystack/build/webapplication
135- # cd ./macless_haystack/build/webapplication
136- # zip -r webapplication.zip .
137- # - name: Upload Web Artifacts
138- # uses: actions/upload-artifact@v6
139- # with:
140- # name: webapplication
141- # path: ./macless_haystack/build/webapplication
142- #
131+ - name : Copy files to web application
132+ run : |
133+ mkdir -p ./macless_haystack/build/webapplication
134+ cp -R ./macless_haystack/build/web ./macless_haystack/build/webapplication
135+ cd ./macless_haystack/build/webapplication
136+ zip -r webapplication.zip .
137+ - name : Upload Web Artifacts
138+ uses : actions/upload-artifact@v6
139+ with :
140+ name : webapplication
141+ path : ./macless_haystack/build/webapplication
143142
144143
145144 - name : Cache Nordic DEB
@@ -164,12 +163,12 @@ jobs:
164163 make build
165164 make clean
166165 NRF_MODEL=nrf51 make build
167- # - name: Upload NRF5x firmware
168- # uses: actions/upload-artifact@v6
169- # with:
170- # name: nrf5x-firmware
171- # path: |
172- # firmware/nrf5x/compiled/*.bin
166+ - name : Upload NRF5x firmware
167+ uses : actions/upload-artifact@v6
168+ with :
169+ name : nrf5x-firmware
170+ path : |
171+ firmware/nrf5x/compiled/*.bin
173172
174173 - uses : actions/setup-python@v6
175174 with :
@@ -183,28 +182,28 @@ jobs:
183182 pio run -d firmware/ESP32/
184183 cd firmware/ESP32/.pio/build/esp32dev/
185184 zip -r esp32-firmware.zip firmware.bin partitions.bin bootloader.bin
186- # - name: Upload ESP32 firmware
187- # uses: actions/upload-artifact@v6
188- # with:
189- # name: esp32-firmware
190- # path: |
191- # firmware/ESP32/.pio/build/esp32dev/firmware.bin
192- # firmware/ESP32/.pio/build/esp32dev/partitions.bin
193- # firmware/ESP32/.pio/build/esp32dev/bootloader.bin
194- # - name: Delete old drafts
195- # uses: hugo19941994/[email protected] 196- # env:
197- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
198- # - name: Create Release
199- # uses: "marvinpinto/action-automatic-releases@latest"
200- # with:
201- # repo_token: "${{ secrets.GITHUB_TOKEN }}"
202- # automatic_release_tag: v${{ env.VERSION }}
203- # title: v${{ env.VERSION }}
204- # draft: true
205- # prerelease: false
206- # files: |
207- # generate_keys.py
208- # firmware/ESP32/.pio/build/esp32dev/esp32-firmware.zip
209- # firmware/nrf5x/compiled/*.bin
210- # ./macless_haystack/build/app/outputs/flutter-apk/android-application.apk
185+ - name : Upload ESP32 firmware
186+ uses : actions/upload-artifact@v6
187+ with :
188+ name : esp32-firmware
189+ path : |
190+ firmware/ESP32/.pio/build/esp32dev/firmware.bin
191+ firmware/ESP32/.pio/build/esp32dev/partitions.bin
192+ firmware/ESP32/.pio/build/esp32dev/bootloader.bin
193+ - name : Delete old drafts
194+ uses :
hugo19941994/[email protected] 195+ env :
196+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
197+ - name : Create Release
198+ uses : " marvinpinto/action-automatic-releases@latest"
199+ with :
200+ repo_token : " ${{ secrets.GITHUB_TOKEN }}"
201+ automatic_release_tag : v${{ env.VERSION }}
202+ title : v${{ env.VERSION }}
203+ draft : true
204+ prerelease : false
205+ files : |
206+ generate_keys.py
207+ firmware/ESP32/.pio/build/esp32dev/esp32-firmware.zip
208+ firmware/nrf5x/compiled/*.bin
209+ ./macless_haystack/build/app/outputs/flutter-apk/android-application.apk
0 commit comments