-
Notifications
You must be signed in to change notification settings - Fork 5
64 lines (60 loc) · 2.03 KB
/
release.yaml
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
name: "Release new version"
on:
workflow_dispatch:
inputs:
type:
description: 'Release type'
required: true
default: 'patch'
type: choice
options:
- major
- minor
- patch
latest-release:
description: 'Is latest release?'
required: false
default: true
type: boolean
jobs:
bump-version:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- id: semvers
uses: "WyriHaximus/github-action-next-semvers@v1"
with:
version: ${{ steps.previoustag.outputs.tag }}
- id: bump-version
run: |
VERSION=${{ steps.semvers.outputs[inputs.type] }}
sed -i -E "s/'[0-9]+.[0-9]+.[0-9]+'/'$VERSION'/g" ext_emconf.php
sed -i -E "s/[0-9]+.[0-9]+.[0-9]+/$VERSION/g" Documentation/Settings.cfg
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- id: autocommit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: https://github.com/hoogi91/spreadsheets/releases/tag/${{ steps.bump-version.outputs.version }}
- run: gh release create ${{ steps.bump-version.outputs.version }} --generate-notes --draft --target=${{ steps.autocommit.outputs.commit_hash || github.sha }} --latest=${{ inputs.latest-release }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
runs-on: ubuntu-latest
environment: 'github'
needs: [ bump-version ]
steps:
- run: gh release edit ${{ steps.bump-version.outputs.version }} --draft=false --latest=${{ inputs.latest-release }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: tomasnorre/typo3-upload-ter@v2
with:
api-token: ${{ secrets.TYPO3_API_TOKEN }}