Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
#
# SPDX-FileCopyrightText: 2021-2025 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT

name: Build and publish app release conventionally

on:
workflow_dispatch:
inputs:
prerelease:
description: 'Pre-release'
type: boolean
required: true
prereleaseIdentifier:
description: 'Pre-release identifier'
required: true
default: 'rc'
type: choice
options:
- alpha
- beta
- rc

env:
PHP_VERSION: 8.3

jobs:
build_and_publish:
runs-on: [ubuntu-latest-low, self-hosted]
environment: release

steps:
- name: Check actor permission
uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0
with:
require: write

- name: Set app env
run: |
# Split and keep last
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV

- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
token: ${{ secrets.RELEASE_PAT }}
fetch-depth: 0

- name: Conventional Changelog Action
id: changelog
uses: TriPSs/conventional-changelog-action@952b14bbc4be87e8458a6ac5926fc655608b1b19 # v6
with:
github-token: ${{ secrets.RELEASE_PAT }}
git-user-email: nextcloud-command@users.noreply.github.com
git-user-name: Nextcloud Command Bot
skip-git-pull: "true"
pre-commit: build/pre-commit.js
release-count: 0
version-file: "package.json, package-lock.json"
pre-release: ${{ inputs.prerelease }}
pre-release-identifier: ${{ inputs.prereleaseIdentifier }}

- name: Push tag to releases organization
if: ${{ steps.changelog.outputs.skipped == 'false' }}
run: |
git remote add release https://github.com/nextcloud-releases/${{ env.APP_NAME }}.git
git push release ${{ steps.changelog.outputs.tag }}

- name: Create Release
if: ${{ steps.changelog.outputs.skipped == 'false' }}
id: create_release
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_PAT }}
with:
owner: nextcloud-releases
repo: ${{ env.APP_NAME }}
tag_name: ${{ steps.changelog.outputs.tag }}
release_name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
prerelease: ${{ inputs.prerelease }}
Loading