Skip to content

Release

Release #148

Workflow file for this run

---
name: "Release"
on:
workflow_dispatch:
inputs:
type:
description: "Type (Major / Minor / Patch)"
required: true
default: "Patch"
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 }}