Publish UTBot as an archive #389
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
name: Publish UTBot as an archive | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- '[1-9][0-9][0-9][0-9].[1]?[0-9].[0-9]+' | |
branches: | |
- main | |
jobs: | |
matrix-prep: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- id: set-matrix | |
name: Read config from matrix.json | |
run: | | |
TASKS=$(echo $(cat .github/workflows/matrix.json) | sed 's/ //g' ) | |
echo "matrix=$TASKS" >> $GITHUB_OUTPUT | |
publish: | |
needs: matrix-prep | |
strategy: | |
matrix: ${{ fromJson(needs.matrix-prep.outputs.matrix) }} | |
runs-on: ubuntu-latest | |
env: | |
ARTIFACT_DIR: utbot-artifact | |
container: | |
image: ghcr.io/unittestbot/utbotcpp/base_env:${{ matrix.DOCKER_TAG }} | |
credentials: | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
env: | |
UTBOT_ALL: /utbot_distr | |
UTBOT_INSTALL_DIR: /utbot_distr/install | |
GRPC_PATH: /utbot_distr/install | |
CLI_PATH: /utbot_distr/cli | |
ARTIFACT_DIR: utbot-artifact | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: set version | |
run: | | |
echo $GITHUB_REF_NAME | |
re="^[1-9][0-9]{3}\.[1]?[0-9]\.(0|[1-9][0-9]*)$" | |
if echo $GITHUB_REF_NAME | grep -Eq $re; then | |
export VERSION=$GITHUB_REF_NAME | |
echo "ARTIFACT_NAME=release-$VERSION" >> $GITHUB_ENV | |
else | |
export VERSION=$(date '+%Y.%-m').$GITHUB_RUN_NUMBER | |
echo "ARTIFACT_NAME=dev-$VERSION" >> $GITHUB_ENV | |
fi | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
export RUN_INFO=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID | |
echo "RUN_INFO=RUN_INFO" >> $GITHUB_ENV | |
- name: echo version | |
run: | | |
echo $ARTIFACT_NAME | |
- name: build VSCode plugin | |
run: | | |
chmod +x docker/action-scripts/build-vsix.sh | |
./docker/action-scripts/build-vsix.sh | |
- name: Setup Java for building CLion plugin | |
uses: actions/setup-java@v3 | |
with: | |
distribution: zulu | |
java-version: 11 | |
- name: build CLion plugin | |
run: | | |
chmod +x docker/action-scripts/build-clion-plugin.sh | |
./docker/action-scripts/build-clion-plugin.sh | |
- name: build UTBot | |
run: | | |
chmod +x docker/action-scripts/build-clean-utbot.sh | |
./docker/action-scripts/build-clean-utbot.sh | |
shell: bash | |
- name: prepare UTBot release for Ubuntu | |
run: | | |
chmod +x docker/action-scripts/prepare-ubuntu-release.sh | |
./docker/action-scripts/prepare-ubuntu-release.sh | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: utbot-${{ env.ARTIFACT_NAME }} | |
path: ${{ env.ARTIFACT_DIR }} | |
auto_installation_check: | |
needs: publish | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Download a single artifact | |
uses: actions/download-artifact@v3 | |
- name: Installation check | |
run: | | |
cd $(find . -name utbot-* -type d -print | head -n1) | |
chmod +x ./unpack_and_run_utbot.sh | |
../integration-tests/installation_checks/automated_install_checks.sh ./utbot_distr.tar.gz | |
../integration-tests/installation_checks/clean.sh |