|
94 | 94 | mv previous_release.zip repository/src/modules/rpi-deploy/filesystem/home/pi/code/artifacts/dist.zip |
95 | 95 | echo "Placed release zip at: repository/src/modules/rpi-deploy/filesystem/home/pi/code/artifacts/dist.zip" |
96 | 96 |
|
| 97 | + - name: Parameterize UpdateCLI configuration |
| 98 | + shell: bash |
| 99 | + run: | |
| 100 | + # Extract owner and repository from source_repo input |
| 101 | + OWNER=$(echo "${{ inputs.source_repo }}" | cut -d'/' -f1) |
| 102 | + REPOSITORY=$(echo "${{ inputs.source_repo }}" | cut -d'/' -f2) |
| 103 | + |
| 104 | + # Create the directory for secrets |
| 105 | + mkdir -p repository/src/modules/rpi-deploy/filesystem/home/pi/code/ |
| 106 | + |
| 107 | + # Create secrets.env file with GITHUB_TOKEN |
| 108 | + echo "GITHUB_TOKEN=${{ inputs.github_token }}" > repository/src/modules/rpi-deploy/filesystem/home/pi/code/secrets.env |
| 109 | + |
| 110 | + # Parameterize the updatecli configuration file |
| 111 | + UPDATECLI_CONFIG="repository/src/modules/rpi-deploy/filesystem/home/pi/updatecli/new_stuff/updatecli.d/updatecli_github_commit.yml" |
| 112 | + |
| 113 | + # Replace hardcoded values with parameterized ones |
| 114 | + sed -i "s/owner: jamtools/owner: $OWNER/g" "$UPDATECLI_CONFIG" |
| 115 | + sed -i "s/repository: jamscribe/repository: $REPOSITORY/g" "$UPDATECLI_CONFIG" |
| 116 | + sed -i "s/pattern: \"vjamscribe-.*\$/pattern: \"${{ inputs.version_prefix }}.*\$/g" "$UPDATECLI_CONFIG" |
| 117 | + sed -i "s|run_from_github_release.sh jamtools jamscribe|run_from_github_release.sh $OWNER $REPOSITORY|g" "$UPDATECLI_CONFIG" |
| 118 | + |
| 119 | + # Copy the updatecli config to where the systemd service expects it |
| 120 | + cp "$UPDATECLI_CONFIG" "repository/src/modules/rpi-deploy/filesystem/home/pi/code/updatecli_github_commit.yml" |
| 121 | + |
| 122 | + echo "Updated UpdateCLI config with:" |
| 123 | + echo " Owner: $OWNER" |
| 124 | + echo " Repository: $REPOSITORY" |
| 125 | + echo " Version prefix: ${{ inputs.version_prefix }}" |
| 126 | + echo " Config copied to: /home/pi/code/updatecli_github_commit.yml" |
| 127 | +
|
97 | 128 | - name: Download Raspbian Image |
98 | 129 | shell: bash |
99 | 130 | run: cd repository/src/image && wget -q -c --trust-server-names 'https://downloads.raspberrypi.org/raspios_lite_armhf_latest' |
|
0 commit comments