-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify the workflow and make sure we are using git to checkout
Use the build-in way to add a token. Use pushd/popd to keep the working directory.
- Loading branch information
Showing
3 changed files
with
33 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,18 +13,28 @@ jobs: | |
image: elementary/docker:juno-stable | ||
|
||
steps: | ||
- name: Install git | ||
run: | | ||
add-apt-repository ppa:git-core/ppa -y | ||
apt-get update | ||
apt-get install git -y | ||
- name: Clone repository | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GIT_USER_TOKEN }} | ||
|
||
- name: Build metadata | ||
run: | | ||
ln -s $GITHUB_WORKSPACE /repo | ||
./build.sh focal stable | ||
- name: Push metadata | ||
run: | | ||
./commit.sh | ||
git config --global user.name "$GIT_USER_NAME" | ||
git config --global user.email "$GIT_USER_EMAIL" | ||
git add . | ||
git commit -m "Automatic update of metadata" | ||
git push | ||
env: | ||
GIT_USER_TOKEN: "${{ secrets.GIT_USER_TOKEN }}" | ||
GIT_USER_NAME: "elementaryBot" | ||
GIT_USER_EMAIL: "[email protected]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,9 @@ EOF | |
|
||
apt-mirror | ||
|
||
mkdir /workdir | ||
cd /workdir | ||
APPSTREAM_DIR=/workdir | ||
mkdir ${APPSTREAM_DIR} | ||
pushd ${APPSTREAM_DIR} | ||
|
||
cat <<EOF > asgen-config.json | ||
{ | ||
|
@@ -40,30 +41,36 @@ EOF | |
|
||
appstream-generator process ${DIST} | ||
|
||
popd | ||
|
||
# Clear out the old data | ||
rm -rf /repo/pantheon-data/main/* | ||
rm -f /repo/debian/appstream-data-pantheon-icons-hidpi.install | ||
rm -f /repo/debian/appstream-data-pantheon-icons.install | ||
touch /repo/debian/appstream-data-pantheon-icons-hidpi.install | ||
touch /repo/debian/appstream-data-pantheon-icons.install | ||
rm -rf pantheon-data/main/* | ||
rm -f debian/appstream-data-pantheon-icons-hidpi.install | ||
rm -f debian/appstream-data-pantheon-icons.install | ||
touch debian/appstream-data-pantheon-icons-hidpi.install | ||
touch debian/appstream-data-pantheon-icons.install | ||
|
||
# Copy in the new | ||
cp export/data/${DIST}/main/Components-amd64.yml.gz /repo/pantheon-data/main/pantheon_${DIST}-main_amd64.yml.gz | ||
for f in export/data/${DIST}/main/icons-*; do | ||
cp ${APPSTREAM_DIR}/export/data/${DIST}/main/Components-amd64.yml.gz pantheon-data/main/pantheon_${DIST}-main_amd64.yml.gz | ||
for f in ${APPSTREAM_DIR}/export/data/${DIST}/main/icons-*; do | ||
|
||
# Ignore icon archives with no icons | ||
FILECOUNT=$(tar -tzvvf ${f} | grep -c ^-) || true | ||
[[ $FILECOUNT -gt 0 ]] || continue | ||
|
||
# Strip a path like export/data/bionic/main/[email protected] down to 128x128@2 | ||
OUTDIR=`basename ${f} .tar.gz | cut -d- -f2` | ||
mkdir -p /repo/pantheon-data/main/icons/${OUTDIR} | ||
tar -C /repo/pantheon-data/main/icons/${OUTDIR} -xf ${f} | ||
mkdir -p pantheon-data/main/icons/${OUTDIR} | ||
tar -C pantheon-data/main/icons/${OUTDIR} -xf ${f} | ||
|
||
# Add the extracted directory path to the debian install scripts (either HiDPI or not) | ||
if [[ $OUTDIR == *"@2" ]]; then | ||
echo "pantheon-data/main/icons/${OUTDIR}/* usr/share/app-info/icons/elementary-${CHANNEL}-${DIST}-main/$OUTDIR/" >> /repo/debian/appstream-data-pantheon-icons-hidpi.install | ||
echo "pantheon-data/main/icons/${OUTDIR}/* usr/share/app-info/icons/elementary-${CHANNEL}-${DIST}-main/$OUTDIR/" >> debian/appstream-data-pantheon-icons-hidpi.install | ||
else | ||
echo "pantheon-data/main/icons/${OUTDIR}/* usr/share/app-info/icons/elementary-${CHANNEL}-${DIST}-main/$OUTDIR/" >> /repo/debian/appstream-data-pantheon-icons.install | ||
echo "pantheon-data/main/icons/${OUTDIR}/* usr/share/app-info/icons/elementary-${CHANNEL}-${DIST}-main/$OUTDIR/" >> debian/appstream-data-pantheon-icons.install | ||
fi | ||
done | ||
|
||
# Change the ownership to the current user | ||
chown -R $(id -u):$(id -g) pantheon-data | ||
chown -R $(id -u):$(id -g) debian |