-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (73 loc) · 2.43 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
70
71
72
73
74
75
76
77
78
79
80
81
name: release-current-version
on:
workflow_dispatch:
jobs:
run-test:
name: Run Tests
uses: platformatic/meraki/.github/workflows/test.yml@main
# Create a tag and a release draft from the tag, then we publish the release.
prepare-release:
name: Prepare release tag with current version
needs: run-test
runs-on: ubuntu-latest
outputs:
TAG: v${{ steps.tag-name.outputs.TAG }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: get current version
id: get-current-version
run: |
echo "CURRENT_VERSION=`cat package.json | jq -r .version`" >> $GITHUB_OUTPUT
shell: bash
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
tag_prefix: v
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ steps.get-current-version.outputs.CURRENT_VERSION }}
- name: Export TAG Parameter
id: tag-name
run: |
echo "TAG=`cat package.json | jq -r .version`" >> $GITHUB_OUTPUT
shell: bash
create-draft:
needs: prepare-release
name: Create Draft Release
uses: platformatic/meraki/.github/workflows/release-draft.yml@main
with:
tag_name: ${{ needs.prepare-release.outputs.TAG }}
apply_win_sign: true
secrets: inherit
release:
needs: create-draft
name: Release
runs-on: ubuntu-latest
steps:
- name: Get last Draft
id: last_release
uses: InsonusK/[email protected] # https://github.com/InsonusK/get-latest-release
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
exclude_types: "release|prerelease"
view_top: 1
- name: "Print draft info"
run: |
echo "Releasing:"
echo "id: ${{ steps.last_release.outputs.id }}"
echo "name: ${{ steps.last_release.outputs.name }}"
echo "tag_name: ${{ steps.last_release.outputs.tag_name }}"
echo "created_at: ${{ steps.last_release.outputs.created_atd }}"
- name: "Publish Release"
uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.last_release.outputs.id }}
- name: Edit Release
uses: irongut/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
id: ${{ steps.last_release.outputs.id }}
name: "Platformatic Meraki ${{ steps.last_release.outputs.TAG }}"