Skip to content

Commit

Permalink
Prepare Release 1.8.4 (#417)
Browse files Browse the repository at this point in the history
* Move tasks from Makefile to GitHub workflow

* Rise version number to 1.8.4

* Update changelog

* Remove duplicate entry
  • Loading branch information
albig authored Nov 2, 2023
1 parent f86ca1d commit 4e1a5d6
Show file tree
Hide file tree
Showing 8 changed files with 170 additions and 93 deletions.
41 changes: 32 additions & 9 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
THEME_VERSION=$(cat sass/style.scss | grep Version | sed -r 's/version: +//I')
V="v"
echo Version in style.scss: $THEME_VERSION
if [ "$V$THEME_VERSION" != "${{ github.ref_name }}" ]; then exit 1; fi
- uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -62,17 +63,31 @@ jobs:
- name: Provide deploy_key
env:
DEPLOY_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_USER: 'github-ci'
SSH_HOST: 'wordpress05.gcms.verdigado.net'
run: |
mkdir "$HOME/.ssh"
echo "$DEPLOY_KEY" > "$HOME/.ssh/id_rsa"
file "$HOME/.ssh/id_rsa"
chmod 600 "$HOME/.ssh/id_rsa"
echo "$DEPLOY_KEY" > "$HOME/.ssh/production.key"
chmod 600 "$HOME/.ssh/production.key"
cat >> ~/.ssh/config <<END
Host production
HostName $SSH_HOST
User $SSH_USER
IdentityFile ~/.ssh/production.key
StrictHostKeyChecking no
END
- name: save version
run: echo ${GITHUB_REF##*/} > version.txt
run: echo ${{ github.ref_name }} > version.txt

- name: rsync zipfile, version and changelog
run: rsync -a -e "ssh -o StrictHostKeyChecking=no -i $HOME/.ssh/id_rsa" ../sunflower-${{ github.ref_name }}.zip version.txt [email protected]:/var/www/updateserver/
env:
PAGEID: 1952
run: |
rsync -a sunflower-${{ github.ref_name }}.zip version.txt sunflower/changelog.html production:/var/www/updateserver/
THEME_VERSION=$(cat version.txt | sed -e 's/^v//')
ssh production "cd /var/www && wp post get $PAGEID --field=content | sed -e 's/<version>[^<]*/<version>$THEME_VERSION/g' > /tmp/content-$PAGEID.txt"
ssh production "cd /var/www && wp post update $PAGEID - < /tmp/content-$PAGEID.txt && wp option update blogdescription 'Demoseite für das WordPress-Theme Sunflower $THEME_VERSION' --url=sunflower-theme.de/demo && wp option update blogname 'Sunflower $THEME_VERSION'"
mkdocs:
runs-on: ubuntu-latest
Expand All @@ -91,14 +106,22 @@ jobs:
- name: Provide deploy_key
env:
DEPLOY_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_USER: 'github-ci'
SSH_HOST: 'wordpress05.gcms.verdigado.net'
run: |
mkdir "$HOME/.ssh"
echo "$DEPLOY_KEY" > "$HOME/.ssh/id_rsa"
file "$HOME/.ssh/id_rsa"
chmod 600 "$HOME/.ssh/id_rsa"
echo "$DEPLOY_KEY" > "$HOME/.ssh/production.key"
chmod 600 "$HOME/.ssh/production.key"
cat >> ~/.ssh/config <<END
Host production
HostName $SSH_HOST
User $SSH_USER
IdentityFile ~/.ssh/production.key
StrictHostKeyChecking no
END
- name: save version
run: echo ${GITHUB_REF##*/} > version.txt

- name: rsync documentation
run: rsync -a -e "ssh -o StrictHostKeyChecking=no -i $HOME/.ssh/id_rsa" --delete documentation [email protected]:/var/www/documentation/
run: rsync -a --delete documentation production:/var/www/documentation/
22 changes: 7 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ stop:

compile:
npm run compile:css

compile-silent:
npm run compile:build

Expand All @@ -18,7 +18,7 @@ bundle:

make-pot:
wp i18n make-pot . languages/sunflower.pot \
poedit languages/de_DE.po
poedit languages/de_DE.po
//composer make-pot

upload:
Expand All @@ -30,16 +30,8 @@ upload-nightly:
activate:
ssh sharepic "cd /var/www/sunflower-theme.de/wp-content/themes/ && wp theme install sunflower.zip --force"

VERSION = $(shell grep Version style.css | cut -d: -f2)
DATE = $(shell date)
announce:
ssh sharepic "cd /var/www/sunflower-theme.de && wp option update blogdescription 'Demoseite für das WordPress-Theme Sunflower $(VERSION)' --url=sunflower-theme.de/demo && wp option update blogname 'Sunflower $(VERSION)' && wp post update 1952 -" < announcement.txt

get:
ssh sharepic "cd /var/www/sunflower-theme.de && wp post get 1952 --field=post_content" | sed -e 's/<version>[^<]*/<version>$(VERSION)/g' | sed -e 's/<date>[^<]*/<date>$(DATE)/g' > announcement.txt

deploy:
git push && make compile-silent bundle upload activate get announce
git push && make compile-silent bundle upload activate

deploy-nightly:
make compile-silent bundle upload-nightly
Expand All @@ -51,7 +43,7 @@ childtheme-deploy:
rsync ../sunflower-child.zip sharepic:/var/www/sunflower-theme.de/updateserver/

publish:
@echo "Latest tag was: "
@echo "Latest tag was: "
@git describe --tags --abbrev=0
@read -p "which version do you want to publish now (start with number, NO v): " newversion; \
sed -i "s/Version.*/Version:\ $$newversion/" "sass/style.scss" && \
Expand All @@ -74,7 +66,7 @@ mkdocs-deploy:
js:
npm run build

js-watch:
js-watch:
npm run start

remote-create-dump:
Expand All @@ -101,7 +93,7 @@ sync-db:

remote-create-homepage-txt:
ssh sharepic "cd /var/www/sunflower-theme.de/dumps && wp post get 37 --url=sunflower-theme.de/demo --field=content > homepage.txt"

changelog:
php create-changelog.php

Expand All @@ -115,4 +107,4 @@ test-mobile:
cd ../../../../tests && LOCAL=true MODE=test MOBILE=true python3 test.py

pattern:
cd ../../../../tests && LOCAL=true MODE=pattern python3 test.py && LOCAL=true MODE=patterns MOBILE=true python3 test.py
cd ../../../../tests && LOCAL=true MODE=pattern python3 test.py && LOCAL=true MODE=patterns MOBILE=true python3 test.py
Loading

0 comments on commit 4e1a5d6

Please sign in to comment.