Skip to content

Commit

Permalink
Do not mix stable & pdi-main builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jbigot committed Dec 6, 2024
1 parent ef3f3d1 commit 963a749
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 17 deletions.
36 changes: 23 additions & 13 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ jobs:
name: Checkout packages
uses: actions/checkout@v4
with: { ref: pdi-main }
- name: check version
id: version
run: |
set -x
if grep '^Version: *main' pdi/pdi.spec
then echo "pdi_prefix=pdi-main." >> $GITHUB_OUTPUT
else echo "pdi_prefix=" >> $GITHUB_OUTPUT
fi
- uses: docker/login-action@v3
with: { registry: "ghcr.io", username: "${{ github.actor }}", password: "${{ secrets.GITHUB_TOKEN }}" }
- name: Checkout builder script
Expand All @@ -34,6 +42,7 @@ jobs:
python-version: '3.8'
- name: Install deps
run: |
set -x
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
curl -o - https://www.aptly.info/pubkey.txt | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/aptly.gpg > /dev/null
echo "deb http://repo.aptly.info/ squeeze main" | sudo tee /etc/apt/sources.list.d/aptly.list
Expand All @@ -46,19 +55,20 @@ jobs:
KEY_PASSPHRASE: ${{ secrets.KEY_PASSPHRASE }}
DISTRIB: ${{ matrix.distrib }}
run: |
set -x
python3.8 pkg_builder/pkgbuild -D ${DISTRIB} -j 3 -p "${KEY_PASSPHRASE}"
ls -R ./${{ matrix.distrib }}
- name: Upload artifact
uses: actions/upload-artifact@v4
id: artifact
with:
name: ${{ matrix.distrib }}
path: ./${{ matrix.distrib }}
name: ${{steps.version.outputs.pdi_prefix}}${{ matrix.distrib }}
path: ./${{steps.version.outputs.pdi_prefix}}${{ matrix.distrib }}
- name: Make artifact descriptor container
run: |
set -x
echo "${{ github.run_id }}" > run_id
tar -c run_id | docker import - ghcr.io/pdidev/pkgs/lastbuild:${{ matrix.distrib }}
docker push ghcr.io/pdidev/pkgs/lastbuild:${{ matrix.distrib }}
tar -c run_id | docker import - ghcr.io/pdidev/pkgs/lastbuild:${{steps.version.outputs.pdi_prefix}}${{ matrix.distrib }}
docker push ghcr.io/pdidev/pkgs/lastbuild:${{steps.version.outputs.pdi_prefix}}${{ matrix.distrib }}
aggregate:
if: ${{ always() && github.event_name != 'pull_request' }}
needs: build
Expand All @@ -75,6 +85,7 @@ jobs:
- name: Aggregate sources
id: ident
run: |
set -x
mkdir _site
cp data/README.tpl/index.html _site
rm -rf data
Expand All @@ -83,8 +94,8 @@ jobs:
docker pull ghcr.io/pdidev/pkgs/lastbuild:${DISTRIB} || continue
CID="$(docker create ghcr.io/pdidev/pkgs/lastbuild:${DISTRIB} /bin/bash)"
docker cp "${CID}:run_id" "${DISTRIB}.run_id"
echo "${DISTRIB}_run_id=$(cat ${DISTRIB}.run_id)\n"
echo "${DISTRIB}_run_id=$(cat ${DISTRIB}.run_id)\n" >> $GITHUB_OUTPUT
RUN_ID="$(sed 's/\./_/g' <<< "${DISTRIB}_run_id")"
echo "${RUN_ID}=$(cat ${DISTRIB}.run_id)" >> $GITHUB_OUTPUT
done
- uses: actions/download-artifact@v4
continue-on-error: true
Expand Down Expand Up @@ -112,33 +123,32 @@ jobs:
with:
name: pdi-main.debian
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{steps.ident.outputs.debian_run_id}}
run-id: ${{steps.ident.outputs.pdi-main_debian_run_id}}
path: _site/pdi-main.debian
- uses: actions/download-artifact@v4
continue-on-error: true
with:
name: pdi-main.fedora
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{steps.ident.outputs.fedora_run_id}}
run-id: ${{steps.ident.outputs.pdi-main_fedora_run_id}}
path: _site/pdi-main.fedora
- uses: actions/download-artifact@v4
continue-on-error: true
with:
name: pdi-main.ubuntu
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{steps.ident.outputs.ubuntu_run_id}}
run-id: ${{steps.ident.outputs.pdi-main_ubuntu_run_id}}
path: _site/pdi-main.ubuntu
- name: Link to pdi-master
run: |
set -x
cd _site
for DISTRIB in debian fedora ubuntu
do
if [ -d "pdi-main.${DISTRIB}" ]
then ln -s "pdi-master.${DISTRIB}" "pdi-main.${DISTRIB}"
then ln -s "pdi-main.${DISTRIB}" "pdi-master.${DISTRIB}"
fi
done
cd ..
ls -R
- name: Upload page artifact
uses: actions/upload-pages-artifact@v3
publish:
Expand Down
2 changes: 1 addition & 1 deletion README.tpl/README.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ <h1>${distribs} package repository for PDI and related software</h1>
This is the repository that holds the ${distribs} packages of PDI and related projects.
</p>
<p>
The list of repositories for all distributions is available at: <a href="https://github.com/pdidev/repo/">https://github.com/pdidev/repo/</a>
The list of repositories for all distributions is available at: <a href="https://repo.pdi.dev">https://repo.pdi.dev</a>
</p>
<h2>Install the packages</h2>
<p>
Expand Down
6 changes: 3 additions & 3 deletions build.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ distribs:
versions: [ supported, testing, sid ]
repository:
<<: *repository
path: "debian"
path: "pdi-main.debian"
url: "https://repo.pdi.dev/debian/"
ubuntu:
<<: *distribution
repository:
<<: *repository
path: "ubuntu"
path: "pdi-main.ubuntu"
url: "https://repo.pdi.dev/ubuntu/"
fedora:
<<: *distribution
repository:
<<: *repository
path: "fedora"
path: "pdi-main.fedora"
url: "https://repo.pdi.dev/fedora/"
packages:
paraconf:
Expand Down
3 changes: 3 additions & 0 deletions release
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ then
sed "s/%changelog/%changelog\n\* ${RPM_DATE} - ${AUTHOR}\n- Upstream release main/" -i pdi*/*.spec
sed 1p -i pdi/debian/changelog pdiplugin*/debian/changelog
sed "1s/(.*$/(${DEB_PKG_VERSION}-1) unstable devel; urgency=medium\n\n * Upstream release ${VERSION}\n\n -- ${AUTHOR} ${DEB_DATE}\n/" -i pdi/debian/changelog pdiplugin*/debian/changelog
sed 's/path: "/path: "pdi-main./' build.conf
else
sed 's/path: "pdi-main\./path: "/' build.conf
fi

sed \
Expand Down

0 comments on commit 963a749

Please sign in to comment.