-
Notifications
You must be signed in to change notification settings - Fork 11
69 lines (68 loc) · 2.31 KB
/
Copy pathrelease.yml
File metadata and controls
69 lines (68 loc) · 2.31 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
name: Release
on:
workflow_dispatch:
jobs:
create-version:
name: Create version string
runs-on: ubuntu-latest
outputs:
new-version: ${{ steps.create-version.outputs.new-version }}
steps:
- name: Create version string
id: create-version
run: |
new_version=$(date +"%Y.%-m.%-d")
echo "Releasing version: $new_version"
echo "new-version=$new_version" >> $GITHUB_OUTPUT
check-version:
name: Check Version
needs: create-version
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0 # We want all history so we can get all tags since previous git tag
- name: Print all tags
run: |
git tag
- name: Check
run: |
if [ $(git tag -l "v${{ needs.create-version.outputs.new-version }}") ]; then
echo "Version ${{ needs.create-version.outputs.new-version }} already exists!"
exit 1
else
echo "Version ${{ needs.create-version.outputs.new-version }} does not exist"
fi
perform-release:
name: Perform release
needs: [create-version, check-version]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
ref: main
token: ${{ secrets.GH_REPO_TOKEN }}
- name: Setup java
uses: actions/setup-java@v5
with:
java-version: 21
distribution: 'temurin'
cache: 'maven'
- name: Update version in code
run: ./mvnw -B -ntp versions:set -DnewVersion="${{ needs.create-version.outputs.new-version }}" -DgenerateBackupPoms=false
- name: Build
run: ./mvnw -B -ntp package -Pcli --projects spotify-web-api-open-api --also-make
- name: Update Open API
run: ./scripts/patch-open-api.sh
- name: Commit and tag
run: |
git config user.name sonallux
git config user.email 13821543+sonallux@users.noreply.github.com
git add --update
git commit -m "Bump version to ${{ needs.create-version.outputs.new-version }}"
git tag "v${{ needs.create-version.outputs.new-version }}"
- name: Push
run: |
git push --atomic origin main "v${{ needs.create-version.outputs.new-version }}"