################################################################################ # # Manual github workflow to create a draft release with assets files (zip files) # # Author: Gregoire Saunier # Website: http://github.com/gregsaun # # Description: # This workflow is triggered manually and need a release version number (tag) # and branch name as input. It will then create a tag using this version number, # create a draft release, compress zip files containing RepRap Firmware, # PanelDue firmware with custom splashscreen and Bear config files and macros. # Those zip files are then uploaded to the draft release. # ################################################################################ name: Create Bear Duet Config Release # Controls when the action will run. Workflow runs when manually triggered using the UI # or API. on: workflow_dispatch: # Inputs the workflow accepts. inputs: # Duet RRF Release Version duet_rrf_version: description: 'Duet release version. e.g.: 3.3' required: true # Duet PanelDue Release Version duet_paneldue_version: description: 'Duet PanelDue version. e.g.: 3.3.0' required: true # Bear Release Version bear_config_version: description: 'Bear Duet RRF config version to create. e.g.: 1.1.0' required: true # Bear Release Branch branch_name: description: 'Branch name used for the release. e.g.: master' default: 'master' required: false # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: create_release: runs-on: ubuntu-latest steps: # # Checkout the bear-lab-3d/bear_duet_rrf repository # - name: Checkout bear-lab-3d/bear_duet_rrf code uses: actions/checkout@v2 with: ref: ${{ github.event.inputs.branch_name }} # branch to checkout # # Download Duet3D RRF Release Assets # - name: Download Duet3D RRF Release Assets run: | echo -n "Download RRF files..." out_dir="rrf_files" gh release download ${{ github.event.inputs.duet_rrf_version }} --dir "${out_dir}" \ -p 'Duet3_SDiap32_Mini5plus.bin' \ -p 'Duet3Firmware_Mini5plus.uf2' \ -p 'DuetWiFiServer.bin' echo " done" echo "Downloaded files:" ls -lAh "${out_dir}" if [[ $(ls "${out_dir}" | wc -l) != 3 ]]; then echo -e "ERROR: Number of downloaded files does not match, should be 3 files" 1>&2 exit 1 fi echo -n "Download DWC file..." out_dir="dwc_files" gh release download ${{ github.event.inputs.duet_rrf_version }} --dir "${out_dir}" \ -p 'DuetWebControl-SD.zip' echo " done" echo "Downloaded file:" ls -lAh "${out_dir}" if [[ $(ls "${out_dir}" | wc -l) != 1 ]]; then echo -e "ERROR: Number of downloaded files does not match, should be 1 file" 1>&2 exit 1 fi env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} GH_REPO: Duet3D/RepRapFirmware # # Download Duet3D PanelDue Release Assets # - name: Download Duet3D PanelDue Release Assets run: | echo -n "Download PanelDue files..." out_dir="paneldue_files" gh release download ${{ github.event.inputs.duet_paneldue_version }} --dir "${out_dir}" \ -p 'PanelDueFirmware*-5.0i-7.0i-nologo.bin' echo " done" echo "Downloaded files:" ls -lAh "${out_dir}" if [[ $(ls "${out_dir}" | wc -l) != 1 ]]; then echo -e "ERROR: Number of downloaded files does not match, should be 1 file" 1>&2 exit 1 fi env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} GH_REPO: Duet3D/PanelDueFirmware # # Compress release assets # - name: Zip release assets shell: bash run: chmod +x ./scripts/gh_action/zip_release_assets.sh && ./scripts/gh_action/zip_release_assets.sh # # Create tag for the release # - name: Create tag and push it for Bear Duet RRF config run: git tag ${{ github.event.inputs.bear_config_version }} && git push origin --tags # # Create a draft release # - name: Create a release id: create-release-id uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token with: tag_name: ${{ github.event.inputs.bear_config_version }} release_name: Bear Duet RepRap Firmware and Configuration ${{ github.event.inputs.bear_config_version }} body: | ## Improvements ## Bug fixes ## Compatibility ## How to upgrade ## Special thank you draft: true prerelease: true # # Upload assets to the release # - name: Upload Asset RRF id: asset-rrf uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create-release-id.outputs.upload_url }} asset_path: ./release_files/duet_reprap_firmware.zip asset_name: duet_reprap_firmware_${{ github.event.inputs.duet_rrf_version }}.zip asset_content_type: application/zip - name: Upload Asset DWC id: asset-dwc uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create-release-id.outputs.upload_url }} asset_path: ./release_files/DuetWebControl-SD.zip asset_name: duet_web_control_firmware_${{ github.event.inputs.duet_rrf_version }}.zip asset_content_type: application/zip - name: Upload Asset PanelDue Firmware id: asset-paneldue uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create-release-id.outputs.upload_url }} asset_path: ./release_files/duet_paneldue_firmware.zip asset_name: duet_paneldue_firmware_${{ github.event.inputs.duet_paneldue_version }}.zip asset_content_type: application/zip - name: Upload Asset Duet Bear Configuration Files id: asset-duet-bear-config uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create-release-id.outputs.upload_url }} asset_path: ./release_files/duet_bear_config.zip asset_name: bear_duet_rrf_config_${{ github.event.inputs.bear_config_version }}.zip asset_content_type: application/zip - name: Upload Asset PrusaSlicer id: asset-prusaslicer-config uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create-release-id.outputs.upload_url }} asset_path: ./release_files/duet_bear_prusaslicer_config.zip asset_name: bear_duet_prusaslicer_config_${{ github.event.inputs.bear_config_version }}.zip asset_content_type: application/zip