[#13] update readme #17
Workflow file for this run
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
### | |
# Copyright (c) 2023, 2024 ArSysOp | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
# | |
# SPDX-License-Identifier: Apache-2.0 | |
# | |
# Contributors: | |
# ArSysOp - initial API and implementation | |
### | |
name: CI | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- "**" | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build Repository and Product | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Set up Maven | |
uses: stCarolas/[email protected] | |
with: | |
maven-version: 3.9.4 | |
- name: Echo Maven | |
run: echo "MAVEN_OPTS='-Xmx2048m'" > ~/.mavenrc | |
- name: Cache maven repo | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-maven-repo | |
with: | |
# maven files are stored in `~/.m2/repository` on Linux/macOS | |
path: | | |
~/.m2/repository | |
!~/.m2/repository/ru/arsysop/svn | |
!~/.m2/repository/.cache/tycho | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.sha1') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Build with Maven | |
run: mvn clean verify --no-transfer-progress -U | |
- name: Archive repository | |
if: ${{ github.event_name == 'push' }} | |
run: | | |
tar -C ./releng/ru.arsysop.svn.repository/target -czvf repository.tar.gz repository | |
- name: Preserve p2 | |
if: ${{ github.event_name == 'push' }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: p2 | |
path: ./repository.tar.gz | |
deploy: | |
name: Deploy p2 Repository | |
needs: build | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'push' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Download p2 | |
uses: actions/download-artifact@v2 | |
with: | |
name: p2 | |
- name: Prepare metadata | |
run: | | |
mkdir ./composite | |
tar -xzf ./repository.tar.gz -C ./composite | |
cp ./releng/ru.arsysop.svn.releng/compositeArtifacts.xml ./composite | |
cp ./releng/ru.arsysop.svn.releng/compositeContent.xml ./composite | |
- name: Detect build type | |
id: get-destination-dir | |
env: | |
RELEASE_BUILD: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
run: | | |
if ${RELEASE_BUILD} == true; then | |
echo "::set-output name=destination_dir::release" | |
else | |
echo "::set-output name=destination_dir::integration" | |
fi | |
- name: Deploy to Github Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./composite | |
destination_dir: ${{ steps.get-destination-dir.outputs.destination_dir }} | |
keep_files: true | |
- name: Delete p2 | |
uses: geekyeggo/delete-artifact@v1 | |
with: | |
name: p2 | |