-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (39 loc) · 1.28 KB
/
release.yaml
File metadata and controls
42 lines (39 loc) · 1.28 KB
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
# Create an incremental tag on Github using SemVer https://semver.org: x.y.z
# A tag is a release version on Packagist.org, which is
# automatically notified by its webook on tag changes.
name: Release
on:
workflow_dispatch:
inputs:
choice:
type: choice
description: "Release types (x.y.patch / x.minor.z / major.y.z)"
options:
- patch
- minor
- major
jobs:
release:
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
name: Tag for release
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Last version
id: last-version
run: echo "::set-output name=tag::$(git describe --tags `git rev-list --tags --max-count=1`)"
- name: Bump version
id: bump-version
uses: olegsu/semver-action@v1
with:
version: ${{ steps.last-version.outputs.tag }}
bump: ${{ inputs.choice }}
- name: Create tag as version for the package on Packagist.org
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "GitHub Actions"
git tag ${{ steps.bump-version.outputs.version }}
git push origin ${{ steps.bump-version.outputs.version }}