-
-
Notifications
You must be signed in to change notification settings - Fork 3
102 lines (86 loc) · 3.78 KB
/
Copy pathrelease.yml
File metadata and controls
102 lines (86 loc) · 3.78 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
# Don't edit this file!
# It is automatically updated after every release of https://github.com/alejandrohdezma/sbt-ci
# If you want to suggest a change, please open a PR or issue in that repository
# This workflow performs two tasks:
#
# - Creates a release of the project by running `sbt ci-publish` (this task should be added to the project as a command
# alias containing the necessary steps to do a release). Examples of this `ci-publish` alias can be found
# [here](https://github.com/search?q=org%3Aalejandrohdezma+%22ci-publish%22+path%3Abuild.sbt++NOT+is%3Aarchived&type=code).
#
# - Runs `sbt ci-docs` on the project and pushes a commit with the changes (the `ci-docs` task should be added to the
# project as a command alias containing the necessary steps to update documentation: re-generate docs files,
# publish websites, update headers...). Examples of this `ci-docs` alias can be found
# [here](https://github.com/search?q=org%3Aalejandrohdezma+%22ci-docs%22+path%3Abuild.sbt++NOT+is%3Aarchived&type=code).
#
# This workflow will launch on pushed tags. Alternatively one can launch it manually using a "workflow dispatch" to
# create a snapshot release (this won't trigger the documentation update).
name: Release
on:
push:
tags: [v*]
workflow_dispatch:
permissions:
contents: write
jobs:
release:
name: Release a new version of the artifact
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
fetch-depth: 0
- name: Check latest tag follows semantic versioning
if: github.event_name == 'push'
uses: alejandrohdezma/actions/check-semver-tag@v1
- name: Run Coursier Cache Action
uses: coursier/cache-action@bebeeb0e6f48ebad66d3783946588ecf43114433 # v6.4.7
- name: Run Coursier Setup Action
uses: coursier/setup-action@039f736548afa5411c1382f40a5bd9c2d30e0383 # v1.3.9
with:
jvm: liberica:11
apps: sbt
- name: Run `sbt ci-publish`
run: sbt ci-publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
documentation:
needs: [release]
name: Updates documentation and version policy after latest release
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
fetch-depth: 0
ref: main
ssh-key: ${{ secrets.GIT_DEPLOY_KEY }}
- name: Run Coursier Cache Action
uses: coursier/cache-action@bebeeb0e6f48ebad66d3783946588ecf43114433 # v6.4.7
- name: Run Coursier Setup Action
uses: coursier/setup-action@039f736548afa5411c1382f40a5bd9c2d30e0383 # v1.3.9
with:
jvm: liberica:17
apps: sbt
- name: Run `sbt ci-docs`
run: sbt ci-docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY_BASE64 }}
- name: Commit changes by `sbt ci-docs`
uses: alejandrohdezma/actions/commit-and-push@v1
with:
message: Run `sbt ci-docs` [skip ci]
branch: main
- name: Reset `versionPolicyIntention`
run: sed -i -r 's/Compatibility\.(None|BinaryCompatible)/Compatibility.BinaryAndSourceCompatible/g' build.sbt
- name: Commit `versionPolicyIntention` reset
uses: alejandrohdezma/actions/commit-and-push@v1
with:
message: Reset `versionPolicyIntention` [skip ci]
branch: main