-
Notifications
You must be signed in to change notification settings - Fork 4
66 lines (65 loc) · 2.06 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Build and maybe release
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v2
- name: Glob match swedish files
uses: tj-actions/[email protected]
id: glob_swe
with:
files: |
stadgar/swe/**.md
pm/swe/**.md
other_documents/swe/**.md
- name: Glob match english files
uses: tj-actions/[email protected]
id: glob_eng
with:
files: |
stadgar/eng/**.md
pm/eng/**.md
other_documents/eng/**.md
- name: Get current datetime
id: date_hash
shell: bash
run: |
echo "::set-output name=date::$(TZ='Europe/Stockholm' date +%Y%m%d-%H%M%S)"
- name: Create output directory
shell: bash
run: mkdir output
- name: Merge Swedish markdown
shell: bash
run: sed -s '$a\\n\\newpage\n' ${{ steps.glob_swe.outputs.paths }} > swe.md
- name: Merge English markdown
shell: bash
run: sed -s '$a\\n\\newpage\n' ${{ steps.glob_eng.outputs.paths }} > eng.md
- name: Build Swedish pdf
uses: docker://pandoc/latex:2.9
with:
args: --output=output/styrdokument_in_swe_${{ steps.date_hash.outputs.date }}.pdf swe.md
- name: Build English pdf
uses: docker://pandoc/latex:2.9
with:
args: --output=output/styrdokument_in_eng_${{ steps.date_hash.outputs.date }}.pdf eng.md
- name: Create Zip
run: |
zip --junk-paths all_documents_${{ steps.date_hash.outputs.date }}.zip output/*
- name: Release
uses: softprops/action-gh-release@v1
if: github.ref == 'refs/heads/main' # Don't release on PR
with:
tag_name: ${{ steps.date_hash.outputs.date }}
name: Release ${{ steps.date_hash.outputs.date }}
files: |
all_documents_${{ steps.date_hash.outputs.date }}.zip
output/*.pdf