77env :
88 FILENAME_PREFIX : RTK_Surveyor_Firmware_
99 RC_PREFIX : RC-
10+ VERSION : 3.1
1011 POINTPERFECT_TOKEN : ${{ secrets.POINTPERFECT_TOKEN }}
1112
1213jobs :
@@ -67,16 +68,46 @@ jobs:
6768 - name : Get current date
6869 id : date
6970 run : echo "date=$(date +'%b_%d_%Y')" >> $GITHUB_OUTPUT
70-
71+
72+ - name : Get current date
73+ id : dateNoScores
74+ run : echo "dateNoScores=$(date +'%b %d %Y')" >> $GITHUB_OUTPUT
75+
7176 - name : Rename binary
7277 run : |
7378 cd Firmware/RTK_Surveyor
7479 cd build
7580 cd esp32.esp32.esp32
7681 mv RTK_Surveyor.ino.bin ${{ env.FILENAME_PREFIX }}${{ env.RC_PREFIX }}${{ steps.date.outputs.date }}.bin
7782
78- - name : Upload binary to action
79- uses : actions/upload-artifact@v3
80- with :
81- name : ${{ env.FILENAME_PREFIX }}${{ env.RC_PREFIX }}${{ steps.date.outputs.date }}
82- path : ./Firmware/RTK_Surveyor/build/esp32.esp32.esp32/${{ env.FILENAME_PREFIX }}${{ env.RC_PREFIX }}${{ steps.date.outputs.date }}.bin
83+ - name : Push binary to Binaries Repo
84+ uses : dmnemec/copy_file_to_another_repo_action@main
85+ env :
86+ API_TOKEN_GITHUB : ${{ secrets.API_GITHUB_RTK_FILE_TOKEN }}
87+ with :
88+ source_file : ./Firmware/RTK_Surveyor/build/esp32.esp32.esp32/${{ env.FILENAME_PREFIX }}${{ env.RC_PREFIX }}${{ steps.date.outputs.date }}.bin
89+ destination_repo : ' sparkfun/SparkFun_RTK_Firmware_Binaries'
90+ destination_folder : ' '
91+ 92+ user_name : ' nseidle'
93+ commit_message : ' Github Action - Updating Binary ${{ steps.dateNoScores.outputs.dateNoScores }}'
94+
95+ - name : Update JSON File
96+ uses : " DamianReeves/write-file-action@master"
97+ with :
98+ path : RTK-RC-Firmware.json
99+ write-mode : overwrite
100+ contents : |
101+ {"Configurations": [{"Version":"${{ env.VERSION }}-${{ steps.dateNoScores.outputs.dateNoScores }}", "URL":"https://raw.githubusercontent.com/sparkfun/SparkFun_RTK_Firmware_Binaries/main/${{ env.FILENAME_PREFIX }}${{ env.RC_PREFIX }}${{ steps.date.outputs.date }}.bin"}]}
102+
103+ - name : Push JSON to Binaries Repo
104+ uses : dmnemec/copy_file_to_another_repo_action@main
105+ env :
106+ API_TOKEN_GITHUB : ${{ secrets.API_GITHUB_RTK_FILE_TOKEN }}
107+ with :
108+ source_file : RTK-RC-Firmware.json
109+ destination_repo : ' sparkfun/SparkFun_RTK_Firmware_Binaries'
110+ destination_folder : ' '
111+ 112+ user_name : ' nseidle'
113+ commit_message : ' Github Action - Updating JSON ${{ steps.dateNoScores.outputs.dateNoScores }}'
0 commit comments