-
Notifications
You must be signed in to change notification settings - Fork 10
72 lines (71 loc) · 2.91 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
# SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
name: Release
on: workflow_dispatch
jobs:
release:
permissions:
contents: write
environment: release
runs-on: [ubuntu-latest, self-hosted]
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
token: ${{ secrets.RELEASE_PAT }}
fetch-depth: 0
- name: Conventional Changelog Action
id: changelog
uses: TriPSs/conventional-changelog-action@v5
with:
github-token: ${{ secrets.RELEASE_PAT }}
skip-git-pull: "true"
pre-commit: build/pre-commit.js
release-count: 0
version-file: "package.json, package-lock.json"
- name: Read package.json node and npm engines version
if: ${{ steps.changelog.outputs.skipped == 'false' }}
uses: skjnldsv/read-package-engines-version-actions@v1.1
id: versions
with:
fallbackNode: '^16'
fallbackNpm: '^8'
- name: Set up Nextcloud env
if: ${{ steps.changelog.outputs.skipped == 'false' }}
uses: ChristophWurst/setup-nextcloud@v0.3.1
with:
php-version: 'false'
node-version: 'false'
npm-version: ${{ steps.versions.outputs.npmVersion }}
tools: 'krankerl'
- name: Package app
if: ${{ steps.changelog.outputs.skipped == 'false' }}
run: krankerl package
- name: Push tag to releases organization
if: ${{ steps.changelog.outputs.skipped == 'false' }}
run: |
git remote add release https://github.com/nextcloud-releases/twofactor_admin.git
git push release ${{ steps.changelog.outputs.tag }}
- name: Create Release in releases organization
if: ${{ steps.changelog.outputs.skipped == 'false' }}
id: github-release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_PAT }}
with:
tag_name: ${{ steps.changelog.outputs.tag }}
release_name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
files: build/artifacts/twofactor_admin.tar.gz
repository: nextcloud-releases/twofactor_admin
- name: Print assets infos
if: ${{ steps.changelog.outputs.skipped == 'false' }}
run: echo ${{ steps.github-release.outputs.assets }}
- name: Upload app to Nextcloud appstore
if: ${{ steps.changelog.outputs.skipped == 'false' }}
uses: nextcloud-releases/nextcloud-appstore-push-action@v1
with:
app_name: ${{ env.twofactor_admin }}
appstore_token: ${{ secrets.APPSTORE_TOKEN }}
download_url: ${{ fromJson(steps.github-release.outputs.assets)[0].browser_download_url }}
app_private_key: ${{ secrets.APP_PRIVATE_KEY }}