Skip to content

Commit

Permalink
Add "release" github action.
Browse files Browse the repository at this point in the history
  • Loading branch information
kszymukowicz committed Jul 13, 2024
1 parent 061585d commit d2e2db8
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
changelog:
exclude:
labels:
- duplicate
- 'good first issue'
- 'help wanted'
- invalid
- question
- wontfix
categories:
- title: ⚡ Breaking
labels:
- breaking
- title: 🚀 Improved
labels:
- enhancement
- title: 🚑 Fixed
labels:
- bug
- title: 👷 Changed
labels:
- maintenance
- title: 📖 Documentation
labels:
- documentation
- title: ⚙️ Dependencies
labels:
- dependencies
- title: Other changes
labels:
- "*"
8 changes: 7 additions & 1 deletion .github/workflows/TYPO3_12.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: TYPO3 12

on: [ push, pull_request ]
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Release
on:
push:
tags:
- '*'

jobs:
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
outputs:
release-notes-url: ${{ steps.create-release.outputs.url }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check tag
run: |
if ! [[ ${{ github.ref }} =~ ^refs/tags/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then
exit 1
fi
- name: Create release
id: create-release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true

ter-publish:
if: startsWith(github.ref, 'refs/tags/')
needs: [release]
runs-on: ubuntu-latest
env:
TYPO3_EXTENSION_KEY: ${{ env.TYPO3_EXTENSION_KEY }}
TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check tag
run: |
if ! [[ ${{ github.ref }} =~ ^refs/tags/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then
exit 1
fi
- id: get-version
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- id: get-comment
run: echo "comment=See release notes at ${{ needs.release.outputs.release-notes-url }}" >> $GITHUB_OUTPUT

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
extensions: intl, mbstring, json, zip, curl
tools: composer:v2
coverage: none

# TODO later for non composer installs
# - name: Build dependencies
# env:
# BUILD_PATH: Resources/Private/Libs/Build
# LIB_PATH: Resources/Private/Libs
# run: |
# git reset --hard HEAD && git clean -dfx
# curl -L https://clue.engineering/phar-composer-latest.phar -o phar-composer.phar
# composer install -d $(pwd)/$BUILD_PATH
# php phar-composer.phar build $(pwd)/$BUILD_PATH $(pwd)/$LIB_PATH/vendors.phar
# rm phar-composer.phar

- name: Install tailor
run: composer global require typo3/tailor --prefer-dist --no-progress --no-suggest

- name: Publish to TER
run: |
php ~/.composer/vendor/bin/tailor set-version "${{ steps.get-version.outputs.version }}" --no-docs
php ~/.composer/vendor/bin/tailor ter:publish --comment "${{ steps.get-comment.outputs.comment }}" "${{ steps.get-version.outputs.version }}"

0 comments on commit d2e2db8

Please sign in to comment.