Skip to content

Fix asterisk expansion #158

Fix asterisk expansion

Fix asterisk expansion #158

name: Build DQMGUI Installation Package
on: [push]
jobs:
build_and_upload:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.6", "3.8"]
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Checkout repository
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Download and compress dependencies
env:
DMWM_GIT_URL: ${{ vars.DMWM_GIT_URL }}
DMWM_GIT_TAG: ${{ vars.DMWM_GIT_TAG }}
DQMGUI_GIT_URL: ${{ vars.DQMGUI_GIT_URL }}
DQMGUI_GIT_TAG: ${{ vars.DQMGUI_GIT_TAG }}
ROOT_GIT_URL: ${{ vars.ROOT_GIT_URL }}
ROOT_GIT_TAG: ${{ vars.ROOT_GIT_TAG }}
run: |
set -x
export DQMGUI_PYTHON_VERSION=$($(which python3) -c 'import platform; print(platform.python_version())' | cut -d'.' -f1,2)
export RELEASE_TAG=python_${DQMGUI_PYTHON_VERSION}_deployment_${DMWM_GIT_TAG}_dqmgui_${DQMGUI_GIT_TAG}_root_${ROOT_GIT_TAG}
sudo apt update && sudo apt install -y libcurl4-gnutls-dev
# Replace the repos version inside the config, it will matter during installation
sed -Ei "s/PYTHON\_VERSION=[0-9]\.[0-9]{1,2}/PYTHON\_VERSION=${DQMGUI_PYTHON_VERSION}/" config.sh
sed -Ei "s/DMWM\_GIT\_TAG=.+/DMWM\_GIT\_TAG=${DMWM_GIT_TAG}/" config.sh
sed -Ei "s@DMWM\_GIT\_URL=.+@DMWM\_GIT\_URL=${DMWM_GIT_URL}@" config.sh
sed -Ei "s/DQMGUI\_GIT\_TAG=.+/DQMGUI\_GIT\_TAG=${DQMGUI_GIT_TAG}/" config.sh
sed -Ei "s@DQMGUI\_GIT\_URL=.+@DQMGUI\_GIT\_URL=${DQMGUI_GIT_URL}@" config.sh
sed -Ei "s/^ROOT\_GIT\_TAG=.+/ROOT\_GIT\_TAG=${ROOT_GIT_TAG}/" config.sh
sed -Ei "s@^ROOT\_GIT\_URL=.+@ROOT\_GIT\_URL=${ROOT_GIT_URL}@" config.sh
bash download_dependencies.sh
bash build_installation_package.sh TARGET_DIRECTORY="/tmp/dqmgui" ARCHIVE_NAME="dqmgui_$RELEASE_TAG.tar.gz"
echo "Automatically generated release for making the installation package publicly available.
The release name currently follows the convention:
python\_\`Python version\`\_deployment\_\`DMWM_GIT_TAG\`\_dqmgui\_\`DQMGUI_GIT_TAG\`\_root\_\`ROOT_GIT_TAG\`
Used repositories:
* dmwm/deployment ([${DMWM_GIT_TAG}](${DMWM_GIT_URL}/tree/${DMWM_GIT_TAG}))
* DQMGUI ([${DQMGUI_GIT_TAG}](${DQMGUI_GIT_URL}/tree/${DQMGUI_GIT_TAG}))
* ROOT ([${ROOT_GIT_TAG}](${ROOT_GIT_URL}/tree/${ROOT_GIT_TAG}))
* Python $($(which python3) -c 'import platform; print(platform.python_version())')
" >> /tmp/release_body.md
echo "RELEASE_TAG=${RELEASE_TAG}" >> $GITHUB_ENV
- name: Archive package artifact
uses: actions/upload-artifact@v3
with:
name: dqmgui-installation-package
path: |
/tmp/dqmgui/dqmgui_${{ env.RELEASE_TAG }}.tar.gz
# Create a release based on the tags used, so that the artifact is downloadable
# without a GitHub account.
- name: Release
uses: ncipollo/release-action@v1
env:
IS_PRERELEASE: ${{ vars.IS_PRERELEASE }}
with:
artifacts: "/tmp/dqmgui/dqmgui_${{ env.RELEASE_TAG }}.tar.gz"
bodyFile: "/tmp/release_body.md"
tag: ${{ env.RELEASE_TAG }}
prerelease: "${{ env.IS_PRERELEASE }}"
allowUpdates: "true"