-
Notifications
You must be signed in to change notification settings - Fork 95
104 lines (95 loc) · 3.32 KB
/
on-release-tag.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: On release tag push
on:
workflow_dispatch:
# Run after every release to NPM (alpha and stable)
push:
tags:
- v*
defaults:
run:
shell: bash
jobs:
get-log4brains-version:
uses: ./.github/workflows/reusable-get-log4brains-version.yml
wait-for-npm-version-to-be-published:
needs: get-log4brains-version
uses: ./.github/workflows/reusable-wait-for-npm-version-to-be-published.yml
with:
npm-package: log4brains
npm-version: ${{ needs.get-log4brains-version.outputs.version }}
load-nodejs-supported-versions:
uses: ./.github/workflows/reusable-load-nodejs-supported-versions.yml
e2e-tests:
needs:
- load-nodejs-supported-versions
- get-log4brains-version
- wait-for-npm-version-to-be-published
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: ${{ fromJson(needs.load-nodejs-supported-versions.outputs.node_versions) }}
uses: ./.github/workflows/reusable-e2e-tests.yml
with:
npm-package-fullname: log4brains@${{ needs.get-log4brains-version.outputs.version }}
os: ${{ matrix.os }}
node-version: ${{ matrix.node-version }}
e2e-tests-nodejs-current:
needs:
- get-log4brains-version
- wait-for-npm-version-to-be-published
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
uses: ./.github/workflows/reusable-e2e-tests.yml
with:
npm-package-fullname: log4brains@${{ needs.get-log4brains-version.outputs.version }}
os: ${{ matrix.os }}
node-version: current
experimental: true # best effort mode
docker-build-and-push:
needs: e2e-tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push the latest alpha Docker image
working-directory: ./docker
run: |
echo "Log4brains version: "
make print-version-tag
if make print-version-tag | grep alpha &> /dev/null
then
echo "Pushing an alpha release..."
MDF_BRANCH_TAG=alpha make release version-tag branch-tag
else
echo "Pushing a stable release..."
make release version-tag latest-tag
fi
publish-adr:
needs:
- get-log4brains-version
- e2e-tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false # required by JamesIves/github-pages-deploy-action
fetch-depth: 0 # required by Log4brains to work correctly (needs the whole Git history)
# We don't use cache here so we really test a fresh install
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc # current LTS
- name: Install and Build Log4brains
run: |
npm install -g log4brains@${{ needs.get-log4brains-version.outputs.version }}
log4brains build --basePath /${GITHUB_REPOSITORY#*/}/adr
- name: Publish to Github pages
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: .log4brains/out
TARGET_FOLDER: adr