generated from open-southeners/php-package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (42 loc) · 1.26 KB
/
publish.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
name: Publish
on:
push:
tags:
- '**'
jobs:
# @see https://stackoverflow.com/a/72959712/8179249
check-current-branch:
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.check_step.outputs.branch }}
steps:
- name: 🏗 Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🏗 Get current branch
id: check_step
run: |
raw=$(git branch -r --contains ${{ github.ref }})
branch="$(echo ${raw//origin\//} | tr -d '\n')"
echo "{name}=branch" >> $GITHUB_OUTPUT
echo "Branches where this tag exists : $branch."
build:
runs-on: ubuntu-latest
needs: check-current-branch
steps:
- name: 🏗 Checkout code
uses: actions/checkout@v4
- name: 🏗 Get release info
id: query-release-info
uses: release-flow/keep-a-changelog-action@v3
with:
command: query
version: latest
- name: 🚀 Publish to Github releases
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.query-release-info.outputs.release-notes }}
make_latest: contains(${{ needs.check.outputs.branch }}, 'main')
# prerelease: true
# files: '*.vsix'