Skip to content

Commit

Permalink
chore: change workflow to incorporate in-repo manifests
Browse files Browse the repository at this point in the history
  • Loading branch information
khos2ow committed Jan 17, 2025
1 parent bc2fbfe commit 8f91b73
Showing 1 changed file with 58 additions and 7 deletions.
65 changes: 58 additions & 7 deletions .github/workflows/build-deb-v4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ jobs:
- name: Pull Manifest
run: |
set -e
wget -P "${{ steps.init.outputs.manifest-path }}" "http://archive.regolith-desktop.com/manifests/${{ steps.init.outputs.distro }}/${{ steps.init.outputs.codename }}/${{ steps.init.outputs.suite }}-${{ steps.init.outputs.component }}/${{ steps.init.outputs.arch }}/manifest.txt" || true
cp "${{ steps.init.outputs.manifest-path }}/${{ steps.init.outputs.distro }}/${{ steps.init.outputs.codename }}/${{ steps.init.outputs.suite }}-${{ steps.init.outputs.component }}/manifest.txt" ${{ steps.init.outputs.manifest-path }} || true
echo "Current manifest:"
cat ${{ steps.init.outputs.manifest-path }}/manifest.txt || true
Expand Down Expand Up @@ -281,6 +281,8 @@ jobs:
exit 1
fi
mv ${{ steps.init.outputs.manifest-path }}/manifest.txt ${{ steps.init.outputs.manifest-path }}/${{ steps.init.outputs.distro }}_${{ steps.init.outputs.codename }}_${{ steps.init.outputs.suite }}-${{ steps.init.outputs.component }}_manifest.txt
cat ${{ steps.init.outputs.changelogs-path }}/CHANGELOG_${{ steps.init.outputs.target }}.raw.txt | grep ^CHLOG: | cut -c 7- > ${{ steps.init.outputs.changelogs-path }}/CHANGELOG_${{ steps.init.outputs.target }}.txt
cat ${{ steps.init.outputs.changelogs-path }}/CHANGELOG_${{ steps.init.outputs.target }}.raw.txt | grep ^SRCLOG: | cut -c 8- > ${{ steps.init.outputs.changelogs-path }}/SOURCELOG_${{ steps.init.outputs.target }}.txt
Expand Down Expand Up @@ -309,7 +311,6 @@ jobs:
done
rsync --ignore-missing-args ${{ steps.init.outputs.changelogs-path }}/SOURCELOG_${{ steps.init.outputs.target }}.txt root@${{ secrets.KAMATERA_HOSTNAME2 }}:/opt/archives/workspace/
rsync --mkpath ${{ steps.init.outputs.manifest-path }}/manifest.txt root@${{ secrets.KAMATERA_HOSTNAME2 }}:/opt/archives/manifests/${{ steps.init.outputs.distro }}/${{ steps.init.outputs.codename }}/${{ steps.init.outputs.suite }}-${{ steps.init.outputs.component }}/${{ steps.init.outputs.arch }}/
- name: Log Build Output
if: steps.changes.outputs.changed == 1
Expand All @@ -318,13 +319,63 @@ jobs:
echo "package-publish-path:"
find ${{ steps.init.outputs.package-publish-path }}
- name: Upload Artifacts
- name: Upload Manifests
uses: actions/upload-artifact@v4
if: steps.changes.outputs.changed == 1
with:
name: MANIFESTS_${{ steps.init.outputs.target }}
path: "${{ steps.init.outputs.manifest-path }}/*_manifest.txt"

- name: Upload Changelogs
uses: actions/upload-artifact@v4
if: steps.changes.outputs.changed == 1
with:
name: CHANGELOG_${{ steps.init.outputs.target }}
path: ${{ steps.init.outputs.changelogs-path }}/*${{ steps.init.outputs.target }}.txt

# update manifests
manifests:
runs-on: ubuntu-24.04
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: manifests
pattern: MANIFESTS_*
merge-multiple: true

- name: Check Manifests
run: |
for file in manifests/*_manifest.txt; do
if [ ! -f "$$file" ]; then
continue
fi
filename="$(basename $file)"
distro="$(echo $filename | cut -d"_" -f1)"
codename="$(echo $filename | cut -d"_" -f2)"
suite="$(echo $filename | cut -d"_" -f3)"
name="$(echo $filename | cut -d"_" -f4)"
mkdir -p manifests/$distro/$codename/$suite/
mv $file manifests/$distro/$codename/$suite/$name
done
- name: Push Manifest Changes
uses: stefanzweifel/git-auto-commit-action@v5
env:
GITHUB_TOKEN: ${{ secrets.ORG_BROADCAST_TOKEN }}
with:
file_pattern: "*"
commit_message: "chore: update ${{ inputs.stage }} manifest for all packages"
commit_user_name: regolith-bot
commit_user_email: [email protected]
commit_author: "regolith-bot <[email protected]>"

# calculate changelogs
changelogs:
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -360,7 +411,7 @@ jobs:
# rebuild sources
source:
needs: changelogs
needs: [manifests, changelogs]
if: ${{ !failure() && !cancelled() && needs.changelogs.outputs.source-changed != 0 }}
uses: ./.github/workflows/rebuild-sources.yml
with:
Expand All @@ -370,7 +421,7 @@ jobs:

# publish archives
publish:
needs: [changelogs, source]
needs: [manifests, changelogs, source]
if: ${{ !failure() && !cancelled() && needs.changelogs.outputs.package-changed != 0 }}
uses: ./.github/workflows/publish-packages.yml
with:
Expand All @@ -380,7 +431,7 @@ jobs:
# create a release with changlogs
release:
runs-on: ubuntu-24.04
needs: [changelogs, publish]
needs: [manifests, changelogs, publish]
if: ${{ !failure() && !cancelled() && needs.changelogs.outputs.package-changed != 0 }}
steps:
- name: Download Artifacts
Expand All @@ -407,7 +458,7 @@ jobs:
# run the tests
test:
needs: [changelogs, release]
needs: [manifests, changelogs, release]
if: ${{ !failure() && !cancelled() }}
uses: ./.github/workflows/test-desktop-installable2.yml
with:
Expand Down

0 comments on commit 8f91b73

Please sign in to comment.