-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (30 loc) · 1.45 KB
/
launch-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
name: Launch Release
on:
workflow_dispatch
jobs:
get-release-version-number:
runs-on: windows-latest
outputs:
revision: ${{ steps.get-revision.outputs.revision }}
minor: ${{ steps.get-minor-version.outputs.minor }}
major: ${{ steps.get-major-version.outputs.major }}
steps:
- id: get-revision
run: |
$firstCommitSha = "49cded61e36172578146ca1a7ae516540056d8b0"
$lastCommitSha = ((Invoke-WebRequest -uri https://api.github.com/repos/infraweavers/monitoring-agent/git/refs/heads/master -UseBasicParsing).Content | ConvertFrom-Json).object.sha
$response = Invoke-WebRequest -uri https://api.github.com/repos/infraweavers/monitoring-agent/compare/${firstCommitSha}...${lastCommitSha} -UseBasicParsing
echo "::set-output name=revision::$( ($response.Content | ConvertFrom-Json).total_commits )"
- id: get-minor-version
run: echo "::set-output name=minor::1"
- id: get-major-version
run: echo "::set-output name=major::0"
tag-latest-revision:
needs: get-release-version-number
runs-on: ubuntu-latest
steps:
- id: make-tag
uses: tvdias/[email protected]
with:
repo-token: "${{ secrets.INFRAWEAVERS_ACTION_PAT }}"
tag: "${{needs.get-release-version-number.outputs.major}}.${{needs.get-release-version-number.outputs.minor}}.${{needs.get-release-version-number.outputs.revision}}"