Use new repo-update method for Debian
This commit is contained in:
parent
995d8de7e9
commit
30afb3e4a9
55
.github/workflows/debian.yml
vendored
55
.github/workflows/debian.yml
vendored
|
@ -119,20 +119,11 @@ jobs:
|
||||||
name: Update package repository
|
name: Update package repository
|
||||||
needs: [build]
|
needs: [build]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: debian:sid
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y reprepro git
|
apt-get install -y git
|
||||||
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
repository: linux-surface/repo
|
|
||||||
token: ${{ secrets.GITHUB_BOT_TOKEN }}
|
|
||||||
fetch-depth: 0
|
|
||||||
ref: master
|
|
||||||
|
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v1
|
uses: actions/download-artifact@v1
|
||||||
|
@ -141,40 +132,38 @@ jobs:
|
||||||
|
|
||||||
- name: Update repository
|
- name: Update repository
|
||||||
env:
|
env:
|
||||||
GPG_KEY: ${{ secrets.SURFACE_GPG_KEY }}
|
SURFACEBOT_TOKEN: ${{ secrets.GITHUB_BOT_TOKEN }}
|
||||||
|
BRANCH_STAGING: autoupd/staging
|
||||||
GIT_REF: ${{ github.ref }}
|
GIT_REF: ${{ github.ref }}
|
||||||
run: |
|
run: |
|
||||||
cd debian
|
repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git"
|
||||||
|
|
||||||
# Import the GPG key for signing the repository
|
# clone package repository
|
||||||
echo "$GPG_KEY" | base64 -d | gpg --import --no-tty --batch --yes
|
git clone -b "${BRANCH_STAGING}" "${repo}" repo
|
||||||
|
|
||||||
# Add packages to repository
|
# copy packages
|
||||||
for pkg in ../debian-latest/*.deb; do
|
cp debian-latest/* repo/debian/
|
||||||
reprepro --basedir . --component main includedeb release $pkg
|
cd repo/debian
|
||||||
done
|
|
||||||
rm -r ../debian-latest
|
|
||||||
|
|
||||||
# Parse git tag from ref
|
# parse git tag from ref
|
||||||
GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g')
|
GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g')
|
||||||
|
|
||||||
# Convert packages into references
|
# convert packages into references
|
||||||
for pkg in $(find . -name '*.deb'); do
|
for pkg in $(find . -name '*.pkg.tar.zst'); do
|
||||||
echo "linux-surface:$GIT_TAG/$(basename $pkg)" > $pkg.blob
|
echo "linux-surface:$GIT_TAG/$(basename $pkg)" > $pkg.blob
|
||||||
rm $pkg
|
rm $pkg
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: Commit and push
|
# set git identity
|
||||||
uses: github-actions-x/commit@v2.3
|
git config --global user.email "surfacebot@users.noreply.github.com"
|
||||||
with:
|
git config --global user.name "surfacebot"
|
||||||
github-token: ${{ secrets.GITHUB_BOT_TOKEN }}
|
|
||||||
push-branch: master
|
# commit and push
|
||||||
commit-message: Update debian kernel
|
update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
|
||||||
force-add: false
|
git switch -c "${update_branch}"
|
||||||
rebase: true
|
git add .
|
||||||
files: debian/*
|
git commit -m "Update Debian kernel"
|
||||||
name: surfacebot
|
git push --set-upstream origin "${update_branch}"
|
||||||
email: surfacebot@users.noreply.github.com
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
name: Publish release
|
name: Publish release
|
||||||
|
|
Loading…
Reference in a new issue