Merge pull request #626 from Pi4J/debounce_fail_PR623 #292
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: Build develop snapshot and push to download repo | |
| on: | |
| push: | |
| branches: [ develop ] | |
| workflow_dispatch: | |
| jobs: | |
| Build: | |
| name: Build & Deploy Snapshot | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Validate secrets are available | |
| run: | | |
| if [ -z "${{ secrets.OSSRH_USERNAME }}" ]; then | |
| echo "ERROR: OSSRH_USERNAME secret is not set" | |
| exit 1 | |
| fi | |
| if [ -z "${{ secrets.OSSRH_TOKEN }}" ]; then | |
| echo "ERROR: OSSRH_TOKEN secret is not set" | |
| exit 1 | |
| fi | |
| echo "✅ Both OSSRH_USERNAME and OSSRH_TOKEN secrets are available" | |
| echo "Username length: ${#MAVEN_USERNAME}" | |
| echo "Token length: ${#MAVEN_PASSWORD}" | |
| env: | |
| MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
| MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
| - name: Verify Maven settings | |
| run: | | |
| echo "Generated Maven settings.xml:" | |
| cat ~/.m2/settings.xml || echo "No settings.xml found" | |
| env: | |
| MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
| MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
| - name: Get latest Docker image | |
| run: docker pull pi4j/pi4j-builder:2.0 | |
| - name: Build entire Pi4J Project in Docker | |
| env: | |
| MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
| MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
| run: docker run --env MAVEN_USERNAME=$MAVEN_USERNAME --env MAVEN_PASSWORD=$MAVEN_PASSWORD --user "$(id -u):$(id -g)" --rm --volume $(pwd):/build pi4j/pi4j-builder:2.0 clean deploy -Pnative,cross-compile --batch-mode | |
| - name: Make staging directory | |
| run: mkdir staging | |
| - name: Copy distribution files to staging | |
| run: | | |
| cp -r pi4j-distribution/target/*.deb staging | |
| cp -r pi4j-distribution/target/*.zip staging | |
| - name: Upload distribution files to staging | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pi4j-dist | |
| path: staging | |
| DeployPackages: | |
| name: Deploy to APT/Download Repo | |
| needs: [ Build ] | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: Staging | |
| url: 'https://github.com/Pi4J/download' | |
| steps: | |
| - name: Download staged artifacts from build | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: pi4j-dist | |
| - name: Display downloaded build artifacts | |
| shell: bash | |
| run: tree | |
| - name: Publish build packages to APT download repository | |
| uses: dmnemec/copy_file_to_another_repo_action@v1.0.4 | |
| env: | |
| API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} | |
| with: | |
| source_file: 'pi4j-*.*' | |
| destination_repo: 'pi4j/download' | |
| destination_branch: 'main' | |
| user_email: 'team@pi4j.com' | |
| user_name: 'Pi4J Build' |