-
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (80 loc) · 3.51 KB
/
release.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
# 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:
jobs:
release:
name: Release a new version of the artifact
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: Check latest tag follows semantic versioning
if: github.event_name == 'push'
uses: alejandrohdezma/actions/check-semver-tag@v1
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: "liberica"
java-version: "11"
cache: "sbt"
- name: Run `sbt ci-publish`
run: sbt ci-publish
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
ref: main
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: "liberica"
java-version: "17"
cache: "sbt"
- name: Run `sbt ci-docs`
run: sbt ci-docs
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY }}
- 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