Use new repo-update method for Arch

This commit is contained in:
Maximilian Luz 2020-02-17 00:49:21 +01:00
parent f4073f5010
commit e2b06ec44d
No known key found for this signature in database
GPG key ID: 70EC0937F6C26F02

View file

@ -80,15 +80,7 @@ jobs:
steps: steps:
- name: Install dependencies - name: Install dependencies
run: | run: |
pacman -Sy --noconfirm base-devel git pacman -Sy --noconfirm 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
@ -97,48 +89,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: |
cp arch-latest/* arch/ repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git"
rm -r arch-latest
cd arch # clone package repository
repo-add -n linux-surface.db.tar.gz *.pkg.tar.zst git clone -b "${BRANCH_STAGING}" "${repo}" repo
# Sign the updated repository # copy packages
echo "$GPG_KEY" | base64 -d | gpg --import --no-tty --batch --yes cp arch-latest/* repo/arch/
if [ -f 'linux-surface.db.sig' ]; then cd repo/arch
rm linux-surface.db.sig
rm linux-surface.db.tar.gz.sig
rm linux-surface.files.sig
rm linux-surface.files.tar.gz.sig
fi
gpg --detach-sign --batch --no-tty --no-armor -u $GPG_KEY_ID linux-surface.db
gpg --detach-sign --batch --no-tty --no-armor -u $GPG_KEY_ID linux-surface.db.tar.gz
gpg --detach-sign --batch --no-tty --no-armor -u $GPG_KEY_ID linux-surface.files
gpg --detach-sign --batch --no-tty --no-armor -u $GPG_KEY_ID linux-surface.files.tar.gz
# 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 '*.pkg.tar.zst'); 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 arch 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: arch/* git commit -m "Update Arch Linux kernel"
name: surfacebot git push --set-upstream origin "${update_branch}"
email: surfacebot@users.noreply.github.com
release: release:
name: Publish release name: Publish release