-
Notifications
You must be signed in to change notification settings - Fork 2
147 lines (127 loc) · 4.07 KB
/
Copy pathci.yml
File metadata and controls
147 lines (127 loc) · 4.07 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Continuous Integration
on:
pull_request:
branches: ['**', '!update/**', '!pr/**']
push:
branches: ['main']
tags: [v*]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
concurrency:
group: ${{ github.workflow }} @ ${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build and Test
strategy:
matrix:
os: [ubuntu-latest]
scala: [3]
java: [temurin@21]
project: [jvm]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- uses: taiki-e/install-action@just
- uses: coursier/setup-action@main
with:
jvm: temurin@21
apps: scala-cli
- name: Checkout current branch (full)
uses: actions/checkout@main
with:
fetch-depth: 0
- name: Install required libraries
run: sudo apt-get update && sudo apt-get install -y libgtk-4-dev libgraphene-1.0-dev libavif-dev
- name: Cache Playwright dependencies
id: cache-pw
uses: actions/cache@main
with:
path: /home/runner/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('playwrightVersion.mill') }}
restore-keys: |
playwright-${{ runner.os }}-${{ hashFiles('playwrightVersion.mill') }}
- name: formatCheck
run: ./mill mill.scalalib.scalafmt.ScalafmtModule/checkFormatAll __.sources
- name: Install Playwright
run: just setupPlaywright
- name: compile
run: ./mill __.compile
- name: scala-cli version
run: scala-cli compile -e "()" --platform js && scala-cli run -e "()"
- name: Test
run: ./mill __.test
publish:
if: github.repository == 'Quafadas/live-server-scala-cli-js' && contains(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
with:
fetch-depth: 0
fetch-tags: true
- uses: coursier/setup-action@main
with:
jvm: temurin@21
apps: scala-cli
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.PGP_SECRET }}
passphrase: ${{ secrets.PUBLISH_SECRET_KEY_PASSWORD }}
git_config_global: true
- name: Prepare GPG
run: |
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
gpgconf --reload gpg-agent
- name: List keys
run: gpg -K
- name: Publish to Maven Central
run: ./mill mill.javalib.SonatypeCentralPublishModule/publishAll --publishArtifacts __.publishArtifacts
env:
MILL_PGP_PASSPHRASE: ${{ secrets.PUBLISH_SECRET_KEY_PASSWORD }}
MILL_PGP_SECRET_BASE64: ${{ secrets.PGP_SECRET }}
MILL_SONATYPE_PASSWORD: ${{ secrets.PUBLISH_PASSWORD }}
MILL_SONATYPE_USERNAME: ${{ secrets.PUBLISH_USER }}
# site:
# if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref == 'refs/tags/')
# needs: build
# runs-on: ubuntu-latest
# steps:
# - uses: coursier/setup-action@main
# with:
# jvm: temurin@21
# apps: scala-cli
# - uses: actions/checkout@main
# with:
# fetch-depth: 0
# fetch-tags: true
# - run: ./mill site.publishDocs
# - name: Setup Pages
# uses: actions/configure-pages@main
# - uses: actions/upload-artifact@main
# with:
# name: page
# path: out/site/publishDocs.dest
# if-no-files-found: error
# deploy:
# needs: site
# permissions:
# pages: write
# id-token: write
# environment:
# name: github-pages
# url: ${{ steps.deployment.outputs.page_url }}
# runs-on: ubuntu-latest
# steps:
# - uses: actions/download-artifact@main
# with:
# name: page
# path: .
# - uses: actions/configure-pages@main
# - uses: actions/upload-pages-artifact@main
# with:
# path: .
# - name: Deploy to GitHub Pages
# id: deployment
# uses: actions/deploy-pages@main