Skip to content

tag 4 release

tag 4 release #31

Workflow file for this run

name: CD
on:
# We limit this workflow to pushes of tags. No need to run on prs and on pushes to master
push:
#branches:
# - master
tags:
- '**'
jobs:
# we could try to split in 2 jobs: one for docs, running also on pushes to master, and one for releases, but the
# release one needs the asset from the docs one...
release:
if: ${{ startsWith(github.ref_name, '4.') && !(contains(github.ref_name, 'alpha') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc')) }}
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # apparently required by tj-actions/changed-files
# these could be useful to update the generated docs on any pushes to master which have changes to docs sources
#- name: get changed files - manual
# id: changed-manual
# uses: tj-actions/changed-files@v35
# with:
# files: |
# doc/manual/**
#- name: get changed files - source
# id: changed-source
# uses: tj-actions/changed-files@v35
# with:
# files: |
# src/**
- name: set git credentials as user triggering the build
uses: fregante/setup-git-user@v1
# build and upload api docs
# (was: NB: this happens independently of releases!)
- name: generate and upload api docs
#if: ${{ steps.changed-source.outputs.any_changed == 'true' }}
run: |
chmod 755 ./doc/build/taskfile
./doc/build/taskfile setup_tools
./doc/build/taskfile build_api
mv doc/api .
git fetch
git checkout gh-pages
rm -rf doc-4/api
mv ./api doc-4
git add doc-4/api
git commit -m 'update api docs'
git push
git checkout ${{ github.ref_name }}
# build and upload manual
# (was: NB: this happens _also_ independently of releases!)
- name: generate and upload manual
#if: ${{ steps.changed-manual.outputs.any_changed == 'true' || (github.ref_type == 'tag' && startsWith(github.ref_name, '4.')) }}
run: |
chmod 755 ./doc/build/taskfile
./doc/build/taskfile setup_tools
./doc/build/taskfile build_manual
mv doc/manual/phpxmlrpc_manual.pdf .
git fetch
git checkout gh-pages
mv ./phpxmlrpc_manual.pdf doc-4
git add doc-4/phpxmlrpc_manual.pdf
git commit -m 'update pdf version of manual'
git push
cp doc-4/phpxmlrpc_manual.pdf .
git checkout ${{ github.ref_name }}
mv ./phpxmlrpc_manual.pdf doc/manual
# create release on github, with data from the NEWS file and add docs+demo artifacts
- name: create release assets
#if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, '4.') }}
run: |
tar -cvzf demofiles.tgz demo
tail -n+2 NEWS.md | sed '/## XML-RPC for PHP version/Q' >> announcement.txt
- name: create release on github
#if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, '4.') }}
uses: softprops/action-gh-release@v1
with:
body_path: announcement.txt
files: |
demofiles.tgz
doc/manual/phpxmlrpc_manual.pdf
# update github pages with release info
- name: update website with info about the latest release
#if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, '4.') }}
run: |
git fetch
git checkout gh-pages
sed -i 's|href="https://github.com/gggeek/phpxmlrpc/releases/tag/[^"]*"|href="https://github.com/gggeek/phpxmlrpc/releases/tag/${{ github.ref_name }}"|g' index.html
sed -i 's|<span class="evidence">.*</span>|<span class="evidence">${{ github.ref_name }}</span>|' index.html
sed -i "s|released on [^(]*|released on $(date '+%b. %-d, %Y') |" index.html
sed -i "s|Page last updated:.*|Page last updated: $(date +%Y/%-m/%-d)|" index.html
git add index.html
git commit -m 'update index page with latest release'
git push
git checkout ${{ github.ref_name }}
deploy_to_altervista:
if: ${{ startsWith(github.ref_name, '4.') && !(contains(github.ref_name, 'alpha') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc')) }}
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v3
# add the bits of jsxmlrpc that make the debugger nicer, so that they get uploaded to the demo server
- name: setup visualeditor for the debugger
#if: ${{ steps.changed-manual.outputs.any_changed == 'true' || (github.ref_type == 'tag' && startsWith(github.ref_name, '4.')) }}
run: |
chmod 755 ./taskfile
./taskfile setup_debugger_visualeditor
# upload the lib to gggeek.altervista.org via ftp
- name: upload lib to gggeek.altervista.org - src
#if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, '4.') }}
uses: SamKirkland/[email protected]
with:
server: ftp.gggeek.altervista.org
username: ${{ secrets.ftp_gggeek_altervista_org_user }}
password: ${{ secrets.ftp_gggeek_altervista_org_password }}
protocol: ftps
local-dir: ./src/
server-dir: src/
dangerous-clean-slate: true
- name: upload lib to gggeek.altervista.org - demo
if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, '4.') }}
uses: SamKirkland/[email protected]
with:
server: ftp.gggeek.altervista.org
username: ${{ secrets.ftp_gggeek_altervista_org_user }}
password: ${{ secrets.ftp_gggeek_altervista_org_password }}
protocol: ftps
local-dir: ./demo/
server-dir: demo/
dangerous-clean-slate: true
# NB: codegen and discuss demos will not work anyway because /tmp is not writeable
exclude: |
**/*.pl
**/*.py
**/readme.md
**/codegen.php
**/discuss.php
**/testsuite.php
**/wrapper.php
- name: upload lib to gggeek.altervista.org - debugger
#if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, '4.') }}
uses: SamKirkland/[email protected]
with:
server: ftp.gggeek.altervista.org
username: ${{ secrets.ftp_gggeek_altervista_org_user }}
password: ${{ secrets.ftp_gggeek_altervista_org_password }}
protocol: ftps
local-dir: ./debugger/
server-dir: debugger/
dangerous-clean-slate: true