-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (63 loc) · 2.05 KB
/
ci-and-cd.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
name: CI and CD
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
ci:
name: Build, Lint and Test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Java and Cache deps
uses: ./.github/actions/setup-build
- name: Check format with Scalafmt
run: sbt scalafmtCheckAll
- name: Check lint with Scalafix
run: sbt "scalafix --check"
- name: Build artifact with Test
run: sbt assembly
- name: Clean build artifact for caching target folder
run: rm -r ./target/scala-*/RegenerateWorld-*.jar
cd:
name: Release
runs-on: ubuntu-22.04
needs: ci
if: github.ref == 'refs/heads/main'
# softprops/action-gh-release requires this permisson
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Java and Cache deps
uses: ./.github/actions/setup-build
- name: Conventional Changelog Action
uses: TriPSs/[email protected]
id: changelog
with:
github-token: ${{ secrets.github_token }}
git-user-name: "github-actions[bot]"
git-user-email: "github-actions[bot]@users.noreply.github.com"
skip-version-file: 'true'
skip-git-pull: 'true'
# バージョンが異なっているので、再度Build
- name: Build artifact
run: sbt assembly
if: ${{ steps.changelog.outputs.skipped == 'false' }}
- name: Release
uses: softprops/action-gh-release@v2
if: ${{ steps.changelog.outputs.skipped == 'false' }}
with:
body: ${{ steps.changelog.outputs.clean_changelog }}
tag_name: ${{ steps.changelog.outputs.tag }}
files: ./target/scala-*/RegenerateWorld-*.jar
- name: Clean build artifact for caching target folder
if: ${{ steps.changelog.outputs.skipped == 'false' }}
run: rm -r ./target/scala-*/RegenerateWorld-*.jar