revert, will try later
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				Release Alpine apk for ARM64v8 Edge / compilation-arm64v8 (push) Successful in 2h9m39s
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	Release Alpine apk for ARM64v8 Edge / compilation-arm64v8 (push) Successful in 2h9m39s
				
			This commit is contained in:
		
							parent
							
								
									3b4f0b27d2
								
							
						
					
					
						commit
						de1e940158
					
				
					 1 changed files with 22 additions and 75 deletions
				
			
		| 
						 | 
					@ -8,21 +8,19 @@ on:
 | 
				
			||||||
jobs:
 | 
					jobs:
 | 
				
			||||||
  compilation-arm64v8:
 | 
					  compilation-arm64v8:
 | 
				
			||||||
    runs-on: aarch-64-alpine-edge
 | 
					    runs-on: aarch-64-alpine-edge
 | 
				
			||||||
    env:
 | 
					 | 
				
			||||||
      REPO_URL: "https://static.itmodulo.eu/dl/repo/alpine/edge/main/aarch64"
 | 
					 | 
				
			||||||
      REMOTE_SSH: "${{ secrets.SERVER_LOGIN_AND_ADDRESS }}"
 | 
					 | 
				
			||||||
      REMOTE_PORT: "${{ secrets.LOGIN_PORT }}"
 | 
					 | 
				
			||||||
      REMOTE_PATH: "${{ secrets.SERVER_REPO_PATH }}/edge/main/aarch64"
 | 
					 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - name: setup
 | 
					      - name: Select faster mirror and add tools
 | 
				
			||||||
        shell: sh
 | 
					        shell: sh
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          # faster mirror + essential build tools
 | 
					 | 
				
			||||||
          echo "https://alpine.sakamoto.pl/alpine/$(cat /etc/os-release | grep PRETT | cut -d ' ' -f 3 | cut -d '"' -f 1)/main" > /etc/apk/repositories
 | 
					          echo "https://alpine.sakamoto.pl/alpine/$(cat /etc/os-release | grep PRETT | cut -d ' ' -f 3 | cut -d '"' -f 1)/main" > /etc/apk/repositories
 | 
				
			||||||
          echo "https://alpine.sakamoto.pl/alpine/$(cat /etc/os-release | grep PRETT | cut -d ' ' -f 3 | cut -d '"' -f 1)/community" >> /etc/apk/repositories
 | 
					          echo "https://alpine.sakamoto.pl/alpine/$(cat /etc/os-release | grep PRETT | cut -d ' ' -f 3 | cut -d '"' -f 1)/community" >> /etc/apk/repositories
 | 
				
			||||||
          echo "https://alpine.sakamoto.pl/alpine/$(cat /etc/os-release | grep PRETT | cut -d ' ' -f 3 | cut -d '"' -f 1)/testing" >> /etc/apk/repositories
 | 
					          echo "https://alpine.sakamoto.pl/alpine/$(cat /etc/os-release | grep PRETT | cut -d ' ' -f 3 | cut -d '"' -f 1)/testing" >> /etc/apk/repositories
 | 
				
			||||||
          apk update && apk upgrade
 | 
					          apk -U upgrade
 | 
				
			||||||
          apk add bash git curl alpine-sdk abuild sudo shadow fuse sshfs nodejs wget file
 | 
					          apk add bash git wget curl nodejs sshfs alpine-sdk abuild sudo shadow
 | 
				
			||||||
 | 
					      - name: Checkout
 | 
				
			||||||
 | 
					        uses: actions/checkout@v4
 | 
				
			||||||
 | 
					      - name: Set up environment and users
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
          echo "user_allow_other" >> /etc/fuse.conf
 | 
					          echo "user_allow_other" >> /etc/fuse.conf
 | 
				
			||||||
          adduser runner -u 1003 -D -s /bin/bash -G wheel
 | 
					          adduser runner -u 1003 -D -s /bin/bash -G wheel
 | 
				
			||||||
          addgroup -g 1003 runner
 | 
					          addgroup -g 1003 runner
 | 
				
			||||||
| 
						 | 
					@ -36,75 +34,24 @@ jobs:
 | 
				
			||||||
          chsh -s /bin/bash
 | 
					          chsh -s /bin/bash
 | 
				
			||||||
          su - runner -c 'mkdir ~/.abuild'
 | 
					          su - runner -c 'mkdir ~/.abuild'
 | 
				
			||||||
          echo "setup done"
 | 
					          echo "setup done"
 | 
				
			||||||
 | 
					      - name: Set up keys
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
          wget -q https://static.itmodulo.eu/dl/repo/public_keys/alpine/itmodulo%40disroot.org-65b4f779.rsa.pub -P /etc/apk/keys
 | 
					          wget -q https://static.itmodulo.eu/dl/repo/public_keys/alpine/itmodulo%40disroot.org-65b4f779.rsa.pub -P /etc/apk/keys
 | 
				
			||||||
          su - runner -c 'wget -q https://static.itmodulo.eu/dl/repo/public_keys/alpine/itmodulo%40disroot.org-65b4f779.rsa.pub -P ~/.abuild/'
 | 
					          su - runner -c 'wget -q https://static.itmodulo.eu/dl/repo/public_keys/alpine/itmodulo%40disroot.org-65b4f779.rsa.pub -P ~/.abuild/'
 | 
				
			||||||
          echo "${{ secrets.REPO_PRIVKEY }}" > /home/runner/.abuild/${{ secrets.REPO_PRIVKEY_FILENAME }} && chown runner:runner /home/runner/.abuild/${{ secrets.REPO_PRIVKEY_FILENAME }}
 | 
					          echo "${{ secrets.REPO_PRIVKEY }}" > /home/runner/.abuild/${{ secrets.REPO_PRIVKEY_FILENAME }} && chown runner:runner /home/runner/.abuild/${{ secrets.REPO_PRIVKEY_FILENAME }}
 | 
				
			||||||
          su - runner -c "echo 'PACKAGER_PRIVKEY="/home/runner/.abuild/${{ secrets.REPO_PRIVKEY_FILENAME }}"' >> ~/.abuild/abuild.conf"
 | 
					          su - runner -c "echo 'PACKAGER_PRIVKEY="/home/runner/.abuild/${{ secrets.REPO_PRIVKEY_FILENAME }}"' >> ~/.abuild/abuild.conf"
 | 
				
			||||||
          echo "done"
 | 
					      - name: Compile in sequence
 | 
				
			||||||
 | 
					 | 
				
			||||||
      - name: Checkout sources
 | 
					 | 
				
			||||||
        uses: actions/checkout@v4
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      - name: Fetch remote index and parse existing pkgs, build
 | 
					 | 
				
			||||||
        id: get_remote
 | 
					 | 
				
			||||||
        shell: bash
 | 
					 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          mkdir -p remote_index
 | 
					          ls srcpkgs | tr ' ' '\n'
 | 
				
			||||||
          curl -sfL "${REPO_URL}/APKINDEX.tar.gz" -o remote_index/APKINDEX.tar.gz
 | 
					          mv edge /home/runner/srcpkgs && chown -R runner:runner /home/runner/srcpkgs
 | 
				
			||||||
          tar -xzf remote_index/APKINDEX.tar.gz -C remote_index
 | 
					          echo "/home/runner/packages/srcpkgs" >> /etc/apk/repositories
 | 
				
			||||||
          awk '/^P:/ { pkg=$2 }
 | 
					          su - runner -c 'export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"; cd srcpkgs; for i in $(ls ./ ); do cd $i && abuild -r -c; cd .. ; done'
 | 
				
			||||||
               /^V:/ { ver=$2 }
 | 
					      - name: Mount and upload
 | 
				
			||||||
               /^PR:/{ pr=$2; print pkg "-" ver "-" pr }' \
 | 
					 | 
				
			||||||
            remote_index/APKINDEX > remote_index/list.txt
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
          EXISTING_LIST=remote_index/list.txt
 | 
					 | 
				
			||||||
          ls -lah remote_index
 | 
					 | 
				
			||||||
          file remote_index/list.txt
 | 
					 | 
				
			||||||
          cat remote_index/list.txt
 | 
					 | 
				
			||||||
          mkdir -p newpkgs
 | 
					 | 
				
			||||||
          for d in edge/*; do
 | 
					 | 
				
			||||||
            # skip non-directories
 | 
					 | 
				
			||||||
            [ -d "$d" ] || continue
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            # as runner: source APKBUILD, set ident
 | 
					 | 
				
			||||||
            sudo -u runner bash -c "
 | 
					 | 
				
			||||||
              cd '$d'
 | 
					 | 
				
			||||||
              . APKBUILD
 | 
					 | 
				
			||||||
              echo \"Checking $PKGNAME-$PKGVER-$PKGREL\"
 | 
					 | 
				
			||||||
              if grep -F -x \"$PKGNAME-$PKGVER-$PKGREL\" ../../${EXISTING_LIST}; then
 | 
					 | 
				
			||||||
                echo \" → skip, already in repo\"
 | 
					 | 
				
			||||||
              else
 | 
					 | 
				
			||||||
                echo \" → building…\"
 | 
					 | 
				
			||||||
                abuild -r -c
 | 
					 | 
				
			||||||
                mv /home/runner/packages/srcpkgs/aarch64/${PKGNAME}-*.apk ../../newpkgs/ || true
 | 
					 | 
				
			||||||
              fi
 | 
					 | 
				
			||||||
            "
 | 
					 | 
				
			||||||
          done
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      - name: Sync new pkgs, clean old versions, rebuild & sign index
 | 
					 | 
				
			||||||
        shell: bash
 | 
					 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          # prepare SSH key for sshfs
 | 
					          su - runner -c 'mkdir hole'
 | 
				
			||||||
          echo "${{ secrets.REPO_LOGIN }}" > /home/runner/id_ecdsa
 | 
					          echo "${{ secrets.REPO_LOGIN }}" > /home/runner/id_ecdsa && chown runner:runner /home/runner/id_ecdsa && chmod 600 /home/runner/id_ecdsa
 | 
				
			||||||
          chmod 600 /home/runner/id_ecdsa
 | 
					          su - runner -c 'sshfs -p "${{ secrets.LOGIN_PORT }}" -o StrictHostKeyChecking=accept-new -o default_permissions,allow_other -o IdentityFile=/home/runner/id_ecdsa "${{ secrets.SERVER_LOGIN_AND_ADDRESS }}":"${{ secrets.SERVER_REPO_PATH }}" /home/runner/hole'
 | 
				
			||||||
          mkdir -p /home/runner/remote
 | 
					          su - runner -c 'ls -lah /home/runner/hole/edge/main/aarch64/'
 | 
				
			||||||
          sshfs -p "${REMOTE_PORT}" -o StrictHostKeyChecking=accept-new \
 | 
					          su - runner -c 'rm -rf hole/edge/main/aarch64/*'
 | 
				
			||||||
                -o IdentityFile=/home/runner/id_ecdsa \
 | 
					          su - runner -c 'cp packages/srcpkgs/aarch64/* hole/edge/main/aarch64/'
 | 
				
			||||||
                "${REMOTE_SSH}:${REMOTE_PATH}" /home/runner/remote
 | 
					          su - runner -c 'ls -lah /home/runner/hole/edge/main/aarch64/'
 | 
				
			||||||
 | 
					 | 
				
			||||||
          cd /home/runner/remote
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
          # Remove old iterations of each new pkg
 | 
					 | 
				
			||||||
          for apk in /home/runner/newpkgs/*.apk; do
 | 
					 | 
				
			||||||
            base=$(basename "$apk" | sed 's/-[0-9].*//')
 | 
					 | 
				
			||||||
            rm -f ${base}-*.apk || true
 | 
					 | 
				
			||||||
          done
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
          # Copy new ones in
 | 
					 | 
				
			||||||
          cp /home/runner/newpkgs/*.apk .
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
          # Rebuild index and sign
 | 
					 | 
				
			||||||
          apk index -o APKINDEX.tar.gz *.apk
 | 
					 | 
				
			||||||
          abuild-sign APKINDEX.tar.gz
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
          fusermount -u /home/runner/remote
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue