add workflow files

This commit is contained in:
Intelligent2013 2021-02-24 21:07:54 +03:00
parent 1544f28954
commit 743c402c2f
7 changed files with 246 additions and 0 deletions

35
.github/workflows/macos.yml vendored Normal file
View File

@ -0,0 +1,35 @@
name: macos
on:
push:
branches:
- master
pull_request:
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
# cabextract for fonts
- name: Setup prerequisites
run: |
# Install Maven
brew install maven
# - name: Run tests
# run: |
# make test
- name: Build
run: |
make all

79
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,79 @@
name: release
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
build:
name: Release to Maven and GitHub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
# - name: Run tests
# run: |
# make test
- name: Build
run: |
make all
- name: Compile output
run: |
make publish
# - name: Deploy to Maven
# env:
# # for deploy xsdvi
# GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
# GITHUB_USERNAME: ${{ secrets.PAT_USERNAME }}
# run: |
# make deploy
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Automatic release of ${{ github.ref }}
draft: false
prerelease: false
- name: Get Version
id: get_version
run: |
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/xsdvi-${{ steps.get_version.outputs.VERSION }}.jar
asset_name: xsdvi-${{ steps.get_version.outputs.VERSION }}.jar
asset_content_type: application/java-archive
# - name: Notify xsdvi-ruby
# uses: peter-evans/repository-dispatch@v1
# with:
# token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
# repository: metanorma/xsdvi-ruby
# event-type: metanorma/xsdvi
# client-payload: '{ "ref": "${{ github.ref }}" }'

31
.github/workflows/ubuntu.yml vendored Normal file
View File

@ -0,0 +1,31 @@
name: ubuntu
on:
push:
branches:
- master
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
# - name: Run tests
# run: |
# make test
- name: Build
run: |
make all

33
.github/workflows/windows.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: windows
on:
push:
branches:
- master
pull_request:
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Setup prerequisites
run: choco install --no-progress make gnuwin32-coreutils.install
# - name: Run tests
# run: |
# make test SHELL=cmd
- name: Build
run: |
make all SHELL=cmd

21
Makefile Normal file
View File

@ -0,0 +1,21 @@
#!make
SHELL ?= /bin/bash
#JAR_VERSION := $(shell mvn -q -Dexec.executable="echo" -Dexec.args='$${project.version}' --non-recursive exec:exec -DforceStdout)
JAR_VERSION := 1.0
JAR_FILE := xsdvi-$(JAR_VERSION).jar
all: target/$(JAR_FILE)
target/$(JAR_FILE):
mvn --settings settings.xml -DskipTests clean package shade:shade
deploy:
mvn --settings settings.xml -DskipTests clean deploy shade:shade
clean:
mvn clean
.PHONY: all clean deploy version target/$(JAR_FILE)

19
pom.xml
View File

@ -13,6 +13,25 @@
<jarname>${project.artifactId}-${project.version}.jar</jarname>
<exec.mainClass>xsdvi.XsdVi</exec.mainClass>
</properties>
<distributionManagement>
<repository>
<id>metanorma_xsdvi</id>
<name>GitHub Metanorma Apache Maven Packages</name>
<url>https://maven.pkg.github.com/metanorma/xsdvi</url>
</repository>
</distributionManagement>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<build>
<plugins>
<plugin>

28
settings.xml Normal file
View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8" ?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<activeProfiles>
<activeProfile>multiple-repos</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>multiple-repos</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
</repositories>
</profile>
</profiles>
<servers>
<server>
<id>metanorma_xsdvi</id>
<username>${env.GITHUB_USERNAME}</username>
<password>${env.GITHUB_TOKEN}</password>
</server>
</servers>
</settings>