-
Notifications
You must be signed in to change notification settings - Fork 2
63 lines (56 loc) · 1.59 KB
/
release.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
53
54
55
56
57
58
59
60
61
62
63
name: Create a new release
on:
workflow_dispatch:
pull_request:
push:
tags:
- 'v*.*'
# Ignore simple tags which are just "aliases" used by the Marketplace.
- '!v1'
- '!v2'
- '!v3'
- '!v4'
- '!v5'
- '!v6'
- '!v7'
- '!v8'
- '!v9'
jobs:
version:
name: Calculate the release version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Infer the release version. Assumes that tags are named `vX.Y.Z`.
- id: version
run: |
if [[ "${GITHUB_REF_TYPE}" == 'branch' ]]
then
RELEASE_VERSION="${GITHUB_SHA}"
else
RELEASE_VERSION="${GITHUB_REF#'refs/tags/v'}"
RELEASE_VERSION="${RELEASE_VERSION//'/'/_}"
fi
echo "release-version=${RELEASE_VERSION}" >>"${GITHUB_OUTPUT}"
shell: bash
- id: release
name: Create the release
if: ${{ github.ref_type == 'tag' }}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ github.ref }}
release_name: v${{ steps.version.outputs.release-version }}
draft: false
prerelease: false
outputs:
release-version: ${{ steps.version.outputs.release-version }}
upload-url: ${{ steps.release.outputs.upload_url }}
move-tag:
name: Move the Marketplace tag
needs: [ version ]
uses: ./.github/workflows/move-marketplace-tag.yml
with:
release-version: ${{ needs.version.outputs.release-version }}
secrets: inherit