Add test suite for config-merger #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' # Automatic on tags e.g. v0.1.0, v1.0.0 | |
| workflow_dispatch: # Manual trigger | |
| inputs: | |
| version: | |
| description: "Release version (e.g., v1.0.0, dev)" | |
| required: true | |
| previous_version: | |
| description: "Previous version for delta updates (optional)" | |
| required: false | |
| jobs: | |
| build-config-merger: | |
| name: Build config-merger image | |
| uses: ./.github/workflows/build-config-merger.yml | |
| with: | |
| tag: ${{ github.event_name == 'push' && github.ref_name || inputs.version }} | |
| publish: "true" | |
| build-artifact: | |
| name: Build Mender artifact | |
| needs: build-config-merger | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Mender tools | |
| run: | | |
| # Install xdelta3 for delta updates | |
| sudo apt-get update | |
| sudo apt-get install -y xdelta3 | |
| # Install OpenSSL 1.1 for mender-artifact compatibility | |
| wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb | |
| sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb | |
| # Install mender-artifact | |
| wget https://downloads.mender.io/mender-artifact/3.11.2/linux/mender-artifact | |
| chmod +x mender-artifact | |
| sudo mv mender-artifact /usr/local/bin/ | |
| # Install app-gen | |
| wget https://raw.githubusercontent.com/mendersoftware/app-update-module/1.1.0/gen/app-gen | |
| chmod +x app-gen | |
| sudo mv app-gen /usr/local/bin/ | |
| - name: Set version | |
| id: version | |
| run: | | |
| if [ "${{ github.event_name }}" == "push" ]; then | |
| echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT | |
| echo "prev_version=" >> $GITHUB_OUTPUT | |
| else | |
| echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT | |
| echo "prev_version=${{ inputs.previous_version }}" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Build Mender artifact | |
| run: | | |
| chmod +x scripts/build_mender_artifact.sh | |
| ./scripts/build_mender_artifact.sh "${{ steps.version.outputs.version }}" "${{ steps.version.outputs.prev_version }}" | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: mender-release-${{ steps.version.outputs.version }} | |
| path: | | |
| artifacts/*.mender | |
| artifacts/*.json | |
| manifests/${{ steps.version.outputs.version }}/docker-compose.yaml | |
| retention-days: 90 | |
| - name: Summary | |
| run: | | |
| VERSION="${{ steps.version.outputs.version }}" | |
| echo "## Release ${VERSION}" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "Artifact: \`artifacts/retina-node-${VERSION}.mender\`" >> $GITHUB_STEP_SUMMARY | |
| SIZE=$(jq -r '.artifact_size_mb' artifacts/retina-node-${VERSION}.json) | |
| echo "Size: ${SIZE}MB" >> $GITHUB_STEP_SUMMARY | |
| if [ -n "${{ steps.version.outputs.prev_version }}" ]; then | |
| echo "Delta: ${{ steps.version.outputs.prev_version }} → ${VERSION}" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| - name: Upload to GitHub Release | |
| if: github.event_name == 'push' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| artifacts/retina-node-${{ steps.version.outputs.version }}.mender | |
| artifacts/retina-node-${{ steps.version.outputs.version }}.json | |
| manifests/${{ steps.version.outputs.version }}/docker-compose.yaml | |
| fail_on_unmatched_files: true | |
| - name: Upload to Mender | |
| if: github.event_name == 'push' | |
| uses: mendersoftware/mender-gh-action-upload-artifact@master | |
| with: | |
| mender_pat: ${{ secrets.MENDER_SERVER_ACCESS_TOKEN_APP }} | |
| mender_uri: https://hosted.mender.io | |
| mender_artifact: artifacts/retina-node-${{ steps.version.outputs.version }}.mender |