mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-08-16 20:26:02 +00:00
merge tarball job into pr creation job
This commit is contained in:
@@ -66,38 +66,11 @@ jobs:
|
||||
path: |
|
||||
${{ env.PKGDEST }}/*.pkg.tar.zst
|
||||
|
||||
tarball:
|
||||
name: Determines tarball url and compute checksum
|
||||
create-pr:
|
||||
name: Create PR for AUR
|
||||
if: github.event_name == 'workflow_dispatch' && inputs.create-pr || needs.get-version.outputs.versionType == 'stable'
|
||||
runs-on: ubuntu-latest
|
||||
needs: [get-version, makepkg]
|
||||
if: github.event_name == 'workflow_dispatch' && inputs.create-pr || needs.get-version.outputs.versionType == 'stable'
|
||||
outputs:
|
||||
url: ${{ steps.url.outputs.url}}
|
||||
sha256: ${{ steps.sha256.outputs.sha256}}
|
||||
steps:
|
||||
- name: Determine tarball url
|
||||
id: url
|
||||
run: |
|
||||
URL="";
|
||||
if [[ -n "${INPUT_VERSION}" ]]; then
|
||||
URL="https://github.com/cryptomator/cryptomator/archive/refs/tags/${INPUT_VERSION}.tar.gz"
|
||||
else
|
||||
URL="https://github.com/cryptomator/cryptomator/archive/refs/tags/${{ github.event.release.tag_name }}.tar.gz"
|
||||
fi
|
||||
echo "url=${URL}" >> "$GITHUB_OUTPUT"
|
||||
env:
|
||||
INPUT_VERSION: ${{ inputs.version }}
|
||||
- name: Download source tarball and compute checksum
|
||||
id: sha256
|
||||
run: |
|
||||
curl --silent --fail-with-body -L -H "Accept: application/vnd.github+json" ${{ steps.url.outputs.url }} --output cryptomator.tar.gz
|
||||
TARBALL_SHA256=$(sha256sum cryptomator.tar.gz | cut -d ' ' -f1)
|
||||
echo "sha256=${TARBALL_SHA256}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
aur:
|
||||
name: Create PR for AUR
|
||||
runs-on: ubuntu-latest
|
||||
needs: [tarball, get-version]
|
||||
container:
|
||||
image: archlinux:base-devel
|
||||
env:
|
||||
@@ -109,7 +82,17 @@ jobs:
|
||||
pacman-key --init
|
||||
pacman-key --populate archlinux
|
||||
pacman -Syu --noconfirm --needed git base-devel sudo gnupg maven unzip github-cli
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Download source tarball and compute checksum
|
||||
id: sha256
|
||||
run: |
|
||||
URL="https://github.com/cryptomator/cryptomator/archive/refs/tags/${TAG}.tar.gz"
|
||||
curl --silent --fail-with-body -L -H "Accept: application/vnd.github+json" ${URL} --output cryptomator.tar.gz
|
||||
TARBALL_SHA256=$(sha256sum cryptomator.tar.gz | cut -d ' ' -f1)
|
||||
echo "value=${TARBALL_SHA256}" >> "$GITHUB_OUTPUT"
|
||||
env:
|
||||
TAG: ${{ needs.get-version.outputs.semVerNum || github.event.release.tag_name }}
|
||||
- name: Checkout cryptomator/aur repo
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
repository: 'cryptomator/aur'
|
||||
token: ${{ secrets.CRYPTOBOT_PR_TOKEN }}
|
||||
@@ -150,13 +133,13 @@ jobs:
|
||||
sed -i -e 's|^pkgrel=.*$|pkgrel=${{ steps.pkgrel.outputs.value }}|' PKGBUILD
|
||||
sed -i -e "s|^source=.*$|$TAR_SOURCE|" PKGBUILD
|
||||
sed -i -e "s|^sha256sums=.*$|$TAR_SHA|" PKGBUILD
|
||||
makepkg --printsrcinfo > .SRCINFO
|
||||
sudo -u builder makepkg --printsrcinfo > .SRCINFO
|
||||
env:
|
||||
TAR_SOURCE: |-
|
||||
source=("cryptomator-${pkgver//_/-}.tar.gz::https://github.com/cryptomator/cryptomator/archive/refs/tags/${pkgver//_/-}.tar.gz"
|
||||
"cryptomator-${pkgver//_/-}.tar.gz.asc::https://github.com/cryptomator/cryptomator/releases/download/${pkgver//_/-}/cryptomator-${pkgver//_/-}.tar.gz.asc")
|
||||
TAR_SHA: |-
|
||||
sha256sums=('${{needs.tarball.outputs.sha256}}'
|
||||
sha256sums=('${{steps.sha256.outputs.value}}'
|
||||
'SKIP')
|
||||
- name: Build package with makepkg
|
||||
run: |
|
||||
@@ -167,7 +150,7 @@ jobs:
|
||||
- name: Commit and push
|
||||
run: |
|
||||
git config user.name "cryptobot"
|
||||
git config user.email "automation@cryptomator.org "
|
||||
git config user.email "automation@cryptomator.org"
|
||||
git config push.autoSetupRemote true
|
||||
git stage .
|
||||
git commit -m "Prepare release ${{ needs.get-version.outputs.semVerStr }}-${{ steps.pkgrel.outputs.value }} (${{ steps.pkgrel.outputs.mode }} pkgrel)"
|
||||
|
||||
Reference in New Issue
Block a user