-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (63 loc) · 1.78 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
64
65
66
67
68
69
name: Release
on:
workflow_dispatch:
inputs:
release_type:
description: Type of release
type: choice
required: true
options:
- patch
- minor
- major
jobs:
test:
name: Test
uses: Mobelux/swift-aws-extras/.github/workflows/test.yml@main
release:
name: Release
runs-on: ubuntu-latest
needs: test
permissions:
contents: write
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Get latest release version
id: get_current_version
uses: actions/github-script@v7
with:
script: |
const { data: { tag_name } } = await github.rest.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo
})
return tag_name
- name: Bump version
id: bump
uses: ./.github/actions/bump-version
with:
release-type: ${{ inputs.release_type }}
current-version: ${{ steps.get_current_version.outputs.result }}
- name: Push tag
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ steps.bump.outputs.version }}',
sha: context.sha
})
- name: Create release
uses: actions/github-script@v7
with:
script: |
github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: '${{ steps.bump.outputs.version }}',
generate_release_notes: true,
draft: false,
prerelease: false
})