-
Notifications
You must be signed in to change notification settings - Fork 1
146 lines (127 loc) · 4.58 KB
/
Copy pathrelease-nextcloud.yml
File metadata and controls
146 lines (127 loc) · 4.58 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
name: Release Nextcloud integration
on:
push:
tags:
- 'nextcloud/v*'
workflow_dispatch:
inputs:
version:
description: Version to package without the leading v
required: true
type: string
publish:
description: Publish the versioned and stable GitHub releases
required: true
default: false
type: boolean
permissions:
contents: write
concurrency:
group: release-nextcloud
cancel-in-progress: false
jobs:
release:
name: Build and release Nextcloud
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Resolve release version
id: release
env:
DISPATCH_VERSION: ${{ inputs.version }}
run: |
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
version="${GITHUB_REF_NAME#nextcloud/v}"
else
version="${DISPATCH_VERSION#v}"
fi
if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]]; then
echo "Invalid version: $version" >&2
exit 1
fi
if [[ "$version" == *-* ]]; then
stable=false
prerelease=true
else
stable=true
prerelease=false
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "stable=$stable" >> "$GITHUB_OUTPUT"
echo "prerelease=$prerelease" >> "$GITHUB_OUTPUT"
- name: Verify integration versions
env:
RELEASE_VERSION: ${{ steps.release.outputs.version }}
run: node scripts/integration-version.mjs nextcloud "$RELEASE_VERSION"
- name: Set up pnpm
uses: pnpm/action-setup@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '24.11'
cache: pnpm
- name: Install frontend dependencies
run: pnpm install --frozen-lockfile
- name: Check and build frontend
run: pnpm check
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
coverage: none
extensions: zip
tools: composer:v2
- name: Install and check PHP dependencies
run: |
composer --working-dir=integrations/nextcloud install --no-interaction --prefer-dist --no-progress
composer --working-dir=integrations/nextcloud lint
composer --working-dir=integrations/nextcloud cs:check
composer --working-dir=integrations/nextcloud psalm
composer --working-dir=integrations/nextcloud test:unit
- name: Create release archives
run: pnpm package:nextcloud
- name: Create release notes from changelog
env:
RELEASE_VERSION: ${{ steps.release.outputs.version }}
run: node scripts/changelog-entry.mjs nextcloud "$RELEASE_VERSION" dist/nextcloud/release-notes.md
- name: Upload workflow artifact
uses: actions/upload-artifact@v6
with:
name: butterfly-nextcloud-v${{ steps.release.outputs.version }}
path: dist/nextcloud
- name: Publish GitHub release
if: github.ref_type == 'tag' || inputs.publish
uses: softprops/action-gh-release@v3
with:
tag_name: nextcloud/v${{ steps.release.outputs.version }}
name: Nextcloud v${{ steps.release.outputs.version }}
body_path: dist/nextcloud/release-notes.md
prerelease: ${{ steps.release.outputs.prerelease }}
make_latest: false
files: |
dist/nextcloud/butterfly-nextcloud.tar.gz
dist/nextcloud/butterfly-nextcloud.zip
dist/nextcloud/checksums.txt
- name: Move stable tag to this release
if: ${{ (github.ref_type == 'tag' || inputs.publish) && steps.release.outputs.stable == 'true' }}
env:
STABLE_TAG: nextcloud/stable
run: |
git tag --force "$STABLE_TAG" "$GITHUB_SHA"
git push origin "refs/tags/$STABLE_TAG" --force
- name: Update stable GitHub release
if: ${{ (github.ref_type == 'tag' || inputs.publish) && steps.release.outputs.stable == 'true' }}
uses: softprops/action-gh-release@v3
with:
tag_name: nextcloud/stable
name: Nextcloud Stable
body_path: dist/nextcloud/release-notes.md
prerelease: true
make_latest: false
overwrite_files: true
files: |
dist/nextcloud/butterfly-nextcloud.tar.gz
dist/nextcloud/butterfly-nextcloud.zip
dist/nextcloud/checksums.txt