Skip to content

Commit

Permalink
Update download-and-test-external.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpecovnik committed Jul 14, 2024
1 parent c127256 commit 57a0318
Showing 1 changed file with 25 additions and 20 deletions.
45 changes: 25 additions & 20 deletions .github/workflows/download-and-test-external.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ jobs:
sudo apt update
sudo apt -y clean
- name: Free Github Runner
if: inputs.BUILD_RUNNER == 'ubuntu-latest'
uses: descriptinc/free-disk-space@main
with:
#- name: Free Github Runner
# if: inputs.BUILD_RUNNER == 'ubuntu-latest'
# uses: descriptinc/free-disk-space@main
# with:
# android: true
# dotnet: true
# haskell: true
# large-packages: true
docker-images: true
# docker-images: true
# swap-storage: true

- name: Install SSH key
Expand Down Expand Up @@ -186,6 +186,7 @@ jobs:
gpg --no-default-keyring --keyring trustedkeys.gpg --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 0E98404D386FA1D9
- name: Download
id: calculate
run: |
# default download folder
Expand Down Expand Up @@ -216,8 +217,8 @@ jobs:
# update and get version
sudo apt update
sudo apt search ${INSTALL%% *} 2>/dev/null | grep -w "${INSTALL%% *}" || true >> $GITHUB_STEP_SUMMARY
BEFORE_VERSION=$(sudo apt search ${INSTALL%% *} 2>/dev/null | grep "^${INSTALL%% *}"/ | cut -d" " -f2 | cut -d":" -f2 | sed 's/[^0-9.]*\([0-9.]*\).*/\1/' || true)
echo "BEFORE_VERSION=${BEFORE_VERSION}" >> $GITHUB_OUTPUT
# we use different download metods (github, aplty)
if [[ ${METHOD} == gh ]]; then
gh release download -p '*.deb' --repo ${URL} --dir temp
Expand Down Expand Up @@ -253,13 +254,6 @@ jobs:
find $SOURCE -type f -name "chromium-codecs-ffmpeg_*" | sort | head -n -2 | xargs sudo rm || true
find $SOURCE -type f -name "chromium-codecs-ffmpeg-extra_*" | sort | head -n -2 | xargs sudo rm || true
# store info to GitHub Actions
echo "<details><summary>Show packages</summary><p>" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
find $SOURCE -type f -name "*.deb" | rev | cut -d"/" -f1 | rev | sed -e 's/^/- /;'>> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "</details>" >> $GITHUB_STEP_SUMMARY
# repack deb files
sudo apt-get install devscripts
DEBS=($(sudo find "${SOURCE}"* -type f -name '*thunderbird*.deb' -o -name '*chromium-browser*.deb' -o -name '*chromium_*.deb' -o -name '*firefox_*.deb'))
Expand All @@ -273,6 +267,20 @@ jobs:
sudo mv *.deb ${SOURCE}
done
# store info to GitHub Actions
echo "<details><summary>Show packages</summary><p>" >> $GITHUB_STEP_SUMMARY
echo "Before: $BEFORE_VERSION" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
AFTER_VERSION=$(find $SOURCE -type f -name "${INSTALL%% *}*.deb" -exec dpkg-deb -f {} Version \; | sort | uniq | tail -n 1 | cut -d":" -f2 | sed 's/[^0-9.]*\([0-9.]*\).*/\1/')
echo "AFTER_VERSION=${AFTER_VERSION}" >> $GITHUB_OUTPUT
echo "After: $AFTER_VERSION" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
find $SOURCE -type f -name "*.deb" | rev | cut -d"/" -f1 | rev | sed -e 's/^/- /;'>> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "</details>" >> $GITHUB_STEP_SUMMARY
if [[ ${TARGET} == main ]]; then
if grep -qE 'B' <<< "$REPOSITORY"; then find $SOURCE -type f -name "*.deb" -exec cp {} build/output/debs-beta/ \;; fi
if grep -qE 'S' <<< "$REPOSITORY"; then find $SOURCE -type f -name "*.deb" -exec cp {} build/output/debs/ \;; fi
Expand All @@ -289,8 +297,8 @@ jobs:
done
fi
- name: Deploy to server
if: inputs.REFERENCE == 'main'
- name: "Deploy to server Old: ${{ steps.calculate.outputs.BEFORE_VERSION }} - New: ${{ steps.calculate.outputs.AFTER_VERSION }}"
if: ${{ steps.calculate.outputs.BEFORE_VERSION != steps.calculate.outputs.AFTER_VERSION }}
run: |
rsync -e "ssh -p ${{ secrets.HOST_UPLOAD_PORT }}" -arvc build/output/debs/ ${{ secrets.HOST_UPLOAD_USER }}@${{ secrets.HOST_UPLOAD }}:/incoming/debs
Expand All @@ -302,12 +310,9 @@ jobs:
# read config once again
. os/external/${{ matrix.node }}.conf
cd build
mkdir -p repository/public
mkdir -p output/repository/public
sed -i 's|"gpgProvider": ".*"|"gpgProvider": "gpg2"|g' tools/repository/aptly.conf
tools/repository/repo -i output/debs-beta -c update -p ${{ secrets.GPG_PASSPHRASE1 }}
# show version of package
echo "New version:" >> $GITHUB_STEP_SUMMARY
tools/repository/repo -c show | grep -w "${INSTALL%% *}" || true >> $GITHUB_STEP_SUMMARY
rsync -arvc --rsync-path="mkdir -p /var/www/netcup.armbian.com/html/artifacts/${{ env.PR_NUMBER }}/${{ matrix.node }} && rsync" output/repository/public/ ${{ inputs.HOST_USER }}@${{ inputs.HOST_DEPLOY }}:"/var/www/netcup.armbian.com/html/artifacts/${{ env.PR_NUMBER }}/${{ matrix.node }}"
test:
Expand Down

0 comments on commit 57a0318

Please sign in to comment.