Skip to content

Commit

Permalink
💩 Rewrite CI to a new build system
Browse files Browse the repository at this point in the history
  • Loading branch information
b0g3r committed May 9, 2020
1 parent 4ff7a98 commit cd1e6c5
Show file tree
Hide file tree
Showing 20 changed files with 108 additions and 323 deletions.
119 changes: 71 additions & 48 deletions .github/workflows/tlroadmap_site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,54 @@ on:
- master

jobs:
generate-roadmap-plantuml:
name: Generate roadmap.puml
build-vuepress:
name: Build VuePress site and generate roadmap tree
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# TODO: temporary mock

- name: Upload artifact
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '13.x'

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install js dependencies
run: yarn install --frozen-lockfile

- name: Build vuepress site
run: yarn run site:build

- name: Upload pre-site to artifact
uses: actions/upload-artifact@v1
with:
name: plantuml
path: roadmap.puml
name: vuepress-pre-site
path: tlroadmap/.vuepress/dist

- name: Upload trees
uses: actions/upload-artifact@v1
with:
name: trees
path: tlroadmap/.vuepress/trees

generate-roadmap-freemind:
name: Generate roadmap.mm
generate-roadmap-freemind-plantuml:
name: Generate .mm and .puml
runs-on: ubuntu-latest
needs:
- generate-roadmap-plantuml
- build-vuepress
steps:
- uses: actions/checkout@v2

- uses: actions/download-artifact@v1
with:
name: plantuml
name: trees

- name: Set up Python 3.8
uses: actions/setup-python@v1
Expand All @@ -54,19 +77,31 @@ jobs:
pip install -r tools/requirements.txt
- name: Run plantuml2freemind
run: plantuml2freemind convert plantuml/roadmap.puml roadmap.mm --no-interaction
run: |
mkdir freemind
mkdir plantuml
plantuml2freemind convert trees/tree-ru.json freemind/roadmap-ru.mm --no-interaction
plantuml2freemind convert trees/tree-en.json freemind/roadmap-en.mm --no-interaction
plantuml2freemind convert trees/tree-ru.json plantuml/roadmap-ru.puml --no-interaction
plantuml2freemind convert trees/tree-en.json plantuml/roadmap-en.puml --no-interaction
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: freemind
path: roadmap.mm
path: freemind

- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: plantuml
path: plantuml

generate-roadmap-image:
name: Generate roadmap.svg, roadmap.png
name: Generate .svg and .png
runs-on: ubuntu-latest
needs:
- generate-roadmap-plantuml
- generate-roadmap-freemind-plantuml
steps:
- uses: actions/checkout@v2

Expand All @@ -82,74 +117,62 @@ jobs:
- name: Generate .png and .svg
run: |
mkdir images
cat plantuml/roadmap.puml | java -jar tools/plantuml.jar -charset UTF-8 -pipe > images/roadmap.png
cat plantuml/roadmap.puml | java -jar tools/plantuml.jar -charset UTF-8 -tsvg -pipe > images/roadmap.svg
cat plantuml/roadmap-ru.puml | java -jar tools/plantuml.jar -charset UTF-8 -pipe > images/roadmap-ru.png
cat plantuml/roadmap-en.puml | java -jar tools/plantuml.jar -charset UTF-8 -pipe > images/roadmap-en.png
cat plantuml/roadmap-ru.puml | java -jar tools/plantuml.jar -charset UTF-8 -tsvg -pipe > images/roadmap-ru.svg
cat plantuml/roadmap-en.puml | java -jar tools/plantuml.jar -charset UTF-8 -tsvg -pipe > images/roadmap-en.svg
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: images
path: images

build-vuepress:
name: Build VuePress site
combine-site:
name: Combine artifacts and site
runs-on: ubuntu-latest
needs:
- generate-roadmap-freemind-plantuml
- generate-roadmap-image
- generate-roadmap-plantuml
- generate-roadmap-freemind
- build-vuepress
steps:
- uses: actions/checkout@v2

- uses: actions/download-artifact@v1
with:
name: images
name: vuepress-pre-site

- uses: actions/download-artifact@v1
with:
name: freemind
name: trees

- uses: actions/download-artifact@v1
with:
name: plantuml

- name: Setup Node
uses: actions/setup-node@v1
- uses: actions/download-artifact@v1
with:
node-version: '13.x'
name: freemind

- name: Cache dependencies
uses: actions/cache@v1
- uses: actions/download-artifact@v1
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Prepare roadmap outputs
run: |
mv images/roadmap.png tlroadmap/.vuepress/public/
mv images/roadmap.svg tlroadmap/.vuepress/public/
mv plantuml/roadmap.puml tlroadmap/.vuepress/public/
mv freemind/roadmap.mm tlroadmap/.vuepress/public/
- name: Install js dependencies
run: yarn install --frozen-lockfile
name: images

- name: Build vuepress site
run: yarn run site:build
- run: |
mv -v plantuml/* vuepress-pre-site
mv -v freemind/* vuepress-pre-site
mv -v images/* vuepress-pre-site
mv -v trees/* vuepress-pre-site
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: vuepress-site
path: tlroadmap/.vuepress/dist
path: vuepress-pre-site

check-links:
name: Check broken links
runs-on: ubuntu-latest
needs:
- build-vuepress
- combine-site
steps:
- uses: actions/download-artifact@v1
with:
Expand All @@ -168,7 +191,7 @@ jobs:
name: Publish VuePress site
runs-on: ubuntu-latest
needs:
- build-vuepress
- combine-site
steps:
- uses: actions/download-artifact@v1
with:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ ehthumbs.db
Thumbs.db

# Vuepress
tlroadmap/.vuepress/dist
/tlroadmap/.vuepress/dist
/tlroadmap/.vuepress/trees/*
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"site:build": "vuepress build tlroadmap"
},
"dependencies": {
"@b0g3r/vuepress-plugin-generate-tree": "^0.1.0",
"@b0g3r/vuepress-plugin-generate-tree": "^0.2.6",
"@b0g3r/vuepress-plugin-locale-prefix": "^0.1.1",
"@vuepress/core": "*",
"uslug": "^1.0.4",
Expand Down
129 changes: 0 additions & 129 deletions roadmap.puml

This file was deleted.

9 changes: 7 additions & 2 deletions tlroadmap/.vuepress/components/Roadmap.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<object @load="reformatLinks" class="svg-roadmap" data="/roadmap.svg" type="image/svg+xml">
<img alt="Roadmap file" src="/roadmap.png" />
<object @load="reformatLinks" class="svg-roadmap" data="/roadmap-ru.svg" type="image/svg+xml">
<img alt="Roadmap file" src="/roadmap-ru.png" />
</object>
</template>

Expand All @@ -13,6 +13,11 @@
link.target.baseVal = '_blank';
}
}
},
computed: {
roadmap() {
return this.$roadmap
}
}
}
</script>
Expand Down
5 changes: 3 additions & 2 deletions tlroadmap/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,15 @@ module.exports = (ctx) => ({
'@b0g3r/generate-tree',
{
locales: LOCALES,
dumpingEnabled: ctx.isProd,
},
],
[
'sitemap',
{
ctx.isProd ? {
hostname: HOSTNAME,
dateFormatter: (lastUpdated) => lastUpdated,
},
} : false,
],
[
'seo',
Expand Down
Loading

0 comments on commit cd1e6c5

Please sign in to comment.