Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify workflow #96

Merged
merged 3 commits into from
Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/mscorefonts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# https://packages.debian.org/ru/sid/ttf-mscorefonts-installer
Andale Mono:
- Regular
Arial Black:
- Regular
Arial:
- Bold
- Italic
- Bold Italic
Comic Sans MS:
- Bold
Courier New:
- Bold
- Italic
- Bold Italic
Georgia:
- Bold
- Italic
- Bold Italic
Impact:
- Regular
Times New Roman:
- Bold
- Italic
- Bold Italic
Trebuchet:
- Bold
- Italic
- Bold Italic
Verdana:
- Bold
- Italic
- Bold Italic
Webdings:
- Regular
48 changes: 0 additions & 48 deletions .github/workflows/macos.yml

This file was deleted.

45 changes: 11 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,66 +2,43 @@ 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
env:
GITHUB_TOKEN: ${{ github.token }}
steps:
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

# cabextract for fonts
- name: Setup prerequisites
run: |
sudo apt-get update
sudo apt-get -y install cabextract libxml2-utils

# If necessary
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
sudo apt-get install ttf-mscorefonts-installer

# - name: Setup Cambria fonts
# run: |
# curl -Ls https://raw.githubusercontent.com/metanorma/vista-fonts-installer/master/vista-fonts-installer.sh | sudo bash
- run: |
sudo gem install fontist
fontist update
fontist manifest-install --confirm-license .github/mscorefonts.yml

- uses: actions/checkout@master

- name: Build
env:
GH_TOKEN: ${{ github.token }}
GH_USERNAME: ${{ github.actor }}
run: |
make all
- run: make all

- name: Run tests
env:
GH_TOKEN: ${{ github.token }}
GH_USERNAME: ${{ github.actor }}
run: |
make test
- run: make test

- name: Deploy to Maven
env:
# for download barcode4j
GH_TOKEN: ${{ github.token }}
GH_USERNAME: ${{ github.actor }}
# for deploy mn2pdf
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
GITHUB_USERNAME: ${{ secrets.PAT_USERNAME }}
GITHUB_PUBLISH_TOKEN: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
GITHUB_PUBLISH_USERNAME: metanorma-ci
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 }}
Expand Down Expand Up @@ -89,7 +66,7 @@ jobs:
- name: Notify mn2pdf-ruby
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.PAT_TOKEN }}
token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
repository: metanorma/mn2pdf-ruby
event-type: metanorma/mn2pdf
client-payload: '{ "ref": "${{ github.ref }}" }'
58 changes: 58 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: test

on:
push:
branches:
- master
pull_request:

jobs:
test:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
java: [ 1.8, 1.11 ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
experimental: [ false ]
env:
GITHUB_TOKEN: ${{ github.token }}

steps:
- uses: actions/checkout@master

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}

- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

- if: matrix.os == 'ubuntu-latest'
run: sudo gem install fontist

- if: matrix.os != 'ubuntu-latest'
run: gem install fontist

- run: |
fontist update
fontist manifest-install --confirm-license .github/mscorefonts.yml

- uses: actions/cache@v2
with:
path: ~/.fontist
key: fontist-${{ runner.os }}
restore-keys: fontist-${{ runner.os }}

# - if: matrix.os == 'windows-latest'
# run: choco install --no-progress make

- run: make all

- run: make test
46 changes: 0 additions & 46 deletions .github/workflows/ubuntu.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/windows.yml

This file was deleted.

4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!make
ifeq ($(OS),Windows_NT)
SHELL ?= cmd
else
SHELL ?= /bin/bash
endif

#JAR_VERSION := $(shell mvn -q -Dexec.executable="echo" -Dexec.args='$${project.version}' --non-recursive exec:exec -DforceStdout)
JAR_VERSION := 1.36
Expand Down
4 changes: 1 addition & 3 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
= Metanorma mn2pdf

image:https://github.com/metanorma/mn2pdf/workflows/ubuntu/badge.svg["Build Status", link="https://github.com/metanorma/mn2pdf/actions?workflow=ubuntu"]
image:https://github.com/metanorma/mn2pdf/workflows/macos/badge.svg["Build Status", link="https://github.com/metanorma/mn2pdf/actions?workflow=macos"]
image:https://github.com/metanorma/mn2pdf/workflows/windows/badge.svg["Build Status", link="https://github.com/metanorma/mn2pdf/actions?workflow=windows"]
image:https://github.com/metanorma/mn2pdf/workflows/test/badge.svg["Build Status", link="https://github.com/metanorma/mn2pdf/actions?workflow=test"]

== Installing Build Tools

Expand Down
4 changes: 2 additions & 2 deletions settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
<servers>
<server>
<id>metanorma</id>
<username>${env.GH_USERNAME}</username>
<password>${env.GH_TOKEN}</password>
<username>${env.GITHUB_ACTOR}</username>
<password>${env.GITHUB_TOKEN}</password>
</server>
<server>
<id>metanorma_mn2pdf</id>
Expand Down