-
Notifications
You must be signed in to change notification settings - Fork 164
89 lines (76 loc) · 2.48 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
82
83
84
85
86
87
88
89
---
name: "Release"
on:
workflow_dispatch:
inputs:
type:
description: "Type (Major / Minor / Patch)"
required: true
default: "Patch"
permissions:
contents: write
jobs:
release:
name: "Release"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Configure"
run: |
git config user.name github-actions
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
- name: "Switch"
run: |
git checkout -b release
- name: "Dependencies"
run: |
./scripts/Dependencies.ps1
shell: pwsh
- name: "Version"
id: version
run: |
./scripts/Version.ps1 -Type ${{ github.event.inputs.type }}
$Version = (Import-PowerShellDataFile -Path "./src/AzOps.psd1").ModuleVersion
echo "version=$Version" >> $env:GITHUB_OUTPUT
shell: pwsh
- name: "Release"
run: |
./scripts/Release.ps1 -ApiKey ${{ secrets.PWSH_GALLERY }}
shell: pwsh
- name: "Add"
run: |
git add src/AzOps.psd1
- name: "Commit"
run: |
git commit -m 'Update AzOps.psd1'
- name: "Push"
run: |
git push origin release
#- name: "Merge"
# run: |
# gh pr create --base 'main' --head 'release' --title 'Release v${{ steps.version.outputs.version }}' --body '' --label 'release'
# COUNTER=0
# while : ; do
# DECISION=$(gh pr status --json reviewDecision --jq '.currentBranch.reviewDecision')
# if [ "$DECISION" == "APPROVED" ]; then
# gh pr merge 'release' --squash --delete-branch
# break
# else
# if [ $COUNTER -lt 300 ]; then
# echo "Pending pull request approval - $COUNTER seconds"
# sleep 30s
# COUNTER=$(( $COUNTER + 30 ))
# else
# echo "Expired pull request approval"
# exit 1
# fi
# fi
# done
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Release"
run: |
gh release create ${{ steps.version.outputs.version }} --title 'v${{ steps.version.outputs.version }}' --target 'main' --notes 'Coming soon...'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}