@@ -33,51 +33,46 @@ jobs:
3333 with :
3434 username : ${{ secrets.DOCKERHUB_USERNAME }}
3535 password : ${{ secrets.DOCKERHUB_TOKEN }}
36- - name : Build and push
37- uses : docker/build-push-action@v2
38- with :
39- context : .
40- file : ./Dockerfile
41- builder : ${{ steps.buildx.outputs.name }}
42- push : true
43- tags : mpsq/emacs-native-comp-wayland-builder:latest
4436
4537 artifact :
4638 runs-on : ubuntu-latest
4739 needs : [image]
4840 container :
49- image : mpsq/emacs-native-comp-wayland-builder:latest
50- options : --user root
41+ image : mpsq/emacs-builder:latest
5142 env :
5243 OLD_COMMIT_N : ${{ github.event.inputs.old_commit_n }}
5344 NEW_COMMIT_N : ${{ github.event.inputs.new_commit_n }}
5445 steps :
5546 - name : Prepare artifacts
5647 run : |
57- pacman --noconfirm -S jq openssh bc
58- cd /home/pcr
48+ ./pull.bash
5949
6050 # Get/set version number
61- version=$(ls emacs* | sed -r 's/.*([0-9]{2}\.[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{6}).*/\1/gi')
51+ version=$(grep AC_INIT configure.ac | sed -e 's/^.\+\ \([0-9]\+\.[0-9]\+\.[0-9]\+\?\).\+$/\1/')
52+ version+="."
53+ version+="$NEW_COMMIT_N"
6254 echo "pkg_version=$version" >> $GITHUB_ENV
6355
56+ makepkg
57+
6458 # Unpack artifacts
65- mkdir pkg
66- tar xf "$(ls emacs*)" -C pkg
67- rm pkg/.BUILDINFO pkg/.MTREE pkg/.PKGINFO
68- tar czf "$version".tar.gz -C pkg .
59+ mkdir out
60+ tar xf emacs-1-1-x86_64.pkg.tar.zst -C out
61+ rm emacs-1-1-x86_64.pkg.tar.zst
62+ rm out/.BUILDINFO out/.MTREE out/.PKGINFO
63+ tar czf "$version".tar.gz -C out .
6964 sum=$(sha512sum "$version".tar.gz | sed -r 's/(.*)\s\s.*/\1/')
7065 echo "pkg_sum=$sum" >> $GITHUB_ENV
7166
7267 # Get release body
7368 delta=$(echo "$NEW_COMMIT_N - $OLD_COMMIT_N" | bc)
7469 echo -en "# Commits since last release\n\n" > body.md
75- echo -en "Check [upstream](https://github.com// flatwhatson/emacs/commits) for the full history.\n\n" >> body.md
70+ echo -en "Check [upstream](https://github.com/flatwhatson/emacs/commits) for the full history.\n\n" >> body.md
7671
7772 # Get the list of commits since last release
7873 curl -s "$UPSTREAM_GH"/commits?per_page="$delta" | \
7974 # Parse and retain only the commit message + its url
80- jq -r '.[].commit | (.message | capture("(?<id>.+)\n").id) + " [commit](" + .html_url + ")"' | \
75+ jq -r '.[] | (.commit .message | capture("(?<id>.+)\n").id) + " [commit](" + .html_url + ")"' | \
8176 # Remove "Merge" commits
8277 sed '/^Merge/,+1 d' | \
8378 # Remove any special char at the beginning of the message
@@ -112,32 +107,28 @@ jobs:
112107 PRIV_KEY : ${{ secrets.PRIV_KEY }}
113108 PUB_KEY : ${{ secrets.PUB_KEY }}
114109 run : |
115- cd /root
116110 mkdir .ssh
117111
118112 # Setup SSH
119113 echo "$PUB_KEY" | tr -d '\r' > .ssh/id_aur.pub
120114 echo "$PRIV_KEY" | base64 --decode > .ssh/id_aur
121115 chmod 600 .ssh/id_aur
122- echo -en 'Host aur.archlinux.org\n IdentityFile /root /.ssh/id_aur\n User aur\n' > .ssh/config
116+ echo -en 'Host aur.archlinux.org\n IdentityFile /home/pcr /.ssh/id_aur\n User aur\n' > .ssh/config
123117 ssh-keyscan aur.archlinux.org > .ssh/known_hosts
124118 ssh-keyscan 95.216.144.15 >> .ssh/known_hosts
125119
126120 # Setup git
127- cd /home/pcr
128121 git config --global user.name "Méril Pilon"
129122 git config --global user.email "me@mpsq.org"
130123 git clone ssh://aur.archlinux.org/emacs-gcc-wayland-devel-bin.git
131- chown -R pcr:pcr emacs-gcc-wayland-devel-bin
132124 cd emacs-gcc-wayland-devel-bin
133125
134126 # Amend package, set pkgver, sha512 sum and pkgrel + fix permissions
135127 sed -i -r -e 's~pkgver=.*~pkgver='$PKG_VERSION'~' PKGBUILD
136128 sed -i -r -e 's~sha512sums=.*~sha512sums=\("'"$PKG_SUM"'"\)~' PKGBUILD
137129 sed -i -r -e 's/pkgrel=.*/pkgrel=1/' PKGBUILD
138- chown pcr:pcr PKGBUILD
139130 rm .SRCINFO
140- su pcr -c " makepkg --printsrcinfo > .SRCINFO"
131+ makepkg --printsrcinfo > .SRCINFO
141132
142133 # Push changes
143134 git add .SRCINFO PKGBUILD
0 commit comments