-
-
Notifications
You must be signed in to change notification settings - Fork 714
Expand file tree
/
Copy pathcontinuous-deployment-workflow.yml
More file actions
157 lines (137 loc) · 5.24 KB
/
continuous-deployment-workflow.yml
File metadata and controls
157 lines (137 loc) · 5.24 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
148
149
150
151
152
153
154
155
156
157
name: cd
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- run: git config --global --add safe.directory /__w/re-frame/re-frame
- name: Setup java
uses: actions/setup-java@17f84c3641ba7b8f6deff6309fc4c864478f5d62 # v3
with:
distribution: 'temurin'
java-version: '24'
- name: Install clojure tools
uses: DeLaGuardo/setup-clojure@bc7570e912b028bbcc22f457adec7fdf98e2f4ed # 12.5
with:
cli: 'latest'
bb: 'latest'
- name: Maven cache
id: maven-cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/project.clj', '.github/workflows/**') }}
restore-keys: |
${{ runner.os }}-maven-
- name: npm cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('project.clj') }}-${{ hashFiles('**/deps.cljs') }}
restore-keys: |
${{ runner.os }}-npm-
- name: shadow-cljs compiler cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: .shadow-cljs
key: ${{ runner.os }}-shadow-cljs-${{ github.sha }}
restore-keys: |
${{ runner.os }}-shadow-cljs-
- uses: browser-actions/setup-chrome@c785b87e244131f27c9f19c1a33e2ead956ab7ce # v1
id: setup-chrome
with:
chrome-version: 811961
- name: Test todomvc example
working-directory: examples/todomvc
run: |
npm install
npm run release
- name: Test simple example
working-directory: examples/simple
run: |
npm install
npm run release
- run: bb test :chrome-path '"${{ steps.setup-chrome.outputs.chrome-path }}"'
- name: Slack notification
uses: homoluctus/slatify@61c6b12d2ae226db04062ff9b43d9679e2d53236 # v2.0.1
if: failure() || cancelled()
with:
type: ${{ job.status }}
job_name: re-frame Tests
channel: '#oss-robots'
url: ${{ secrets.SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}
release:
name: Release
needs: test
runs-on: ubuntu-latest
container:
# Source: https://github.com/day8/dockerfiles-for-dev-ci-images
image: ghcr.io/day8/chrome-56:5.0.0
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
fetch-depth: 0
- run: git config --global --add safe.directory /__w/re-frame/re-frame
- name: Maven cache
id: maven-cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/project.clj', '.github/workflows/**') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Setup java
uses: actions/setup-java@17f84c3641ba7b8f6deff6309fc4c864478f5d62 # v3
with:
distribution: 'temurin'
java-version: '24'
- name: Install clojure tools
uses: DeLaGuardo/setup-clojure@bc7570e912b028bbcc22f457adec7fdf98e2f4ed # 12.5
with:
cli: 'latest'
bb: 'latest'
- run: clojure -M:clein deploy
env:
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
CLOJARS_TOKEN: ${{ secrets.CLOJARS_TOKEN }}
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_TOKEN }}
GITHUB_USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# This creates a 'GitHub Release' from the tag and includes link to the releases page
# on the re-frame website. We do not use draft or prerelease features as we always want
# the latest release to show in the right hand column of the project page regardless
# of if it is a stable release.
#
# IMPORTANT: The release year is hard-coded and must be updated in this file once per year for the moment.
# Unfortunately I could not find a way to inject the year using the GitHub Actions ${{ expr }} syntax.
- name: Create GitHub Release
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: |
[Changelog](http://day8.github.io/re-frame/releases/2025/)
draft: false
prerelease: false
- name: Slack notification
uses: homoluctus/slatify@61c6b12d2ae226db04062ff9b43d9679e2d53236 # v2.0.1
if: always()
with:
type: ${{ job.status }}
job_name: re-frame Deployment
channel: '#oss-robots'
url: ${{ secrets.SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}