Skip to content

Commit d0011f0

Browse files
committed
Add push tag script
1 parent 9ea6518 commit d0011f0

2 files changed

Lines changed: 59 additions & 46 deletions

File tree

.github/workflows/update-module.yml

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -112,49 +112,49 @@ jobs:
112112
if: steps.commit.outputs.changes_detected == 'false'
113113
run: echo "No changes detected."
114114

115-
tag-repo:
116-
needs: update-module
117-
if: needs.update-module.outputs.output1 == 'true'
118-
runs-on: ubuntu-latest
119-
steps:
120-
- uses: actions/checkout@v3
121-
with:
122-
token: ${{ secrets.PAT }}
123-
repository: aaronparker/vcredist
124-
125-
- name: Git pull
126-
id: pull
127-
shell: pwsh
128-
run: |
129-
git pull origin main
130-
131-
- name: Get module version number
132-
id: get-version
133-
shell: pwsh
134-
run: |
135-
$manifestPath = "${{ github.workspace }}/VcRedist/VcRedist.psd1"
136-
$manifest = Test-ModuleManifest -Path $manifestPath
137-
Write-Host "Found version: $($manifest.Version)"
138-
echo "::set-output name=version::$($manifest.Version)"
139-
140-
# Import GPG key so that we can sign the commit
141-
- name: Import GPG key
142-
id: import_gpg
143-
uses: crazy-max/ghaction-import-gpg@v5
144-
with:
145-
gpg_private_key: ${{ secrets.GPGKEY }}
146-
passphrase: ${{ secrets.GPGPASSPHRASE }}
147-
git_user_signingkey: true
148-
git_commit_gpgsign: true
149-
git_config_global: true
150-
git_tag_gpgsign: true
151-
git_push_gpgsign: false
152-
git_committer_name: ${{ secrets.COMMIT_NAME }}
153-
git_committer_email: ${{ secrets.COMMIT_EMAIL }}
154-
155-
# Push tag
156-
- name: Push tag
157-
shell: bash
158-
run: |
159-
git tag -a "v${{steps.get-version.outputs.version}}" -m "v${{steps.get-version.outputs.version}}"
160-
git push origin "v${{steps.get-version.outputs.version}}"
115+
# tag-repo:
116+
# needs: update-module
117+
# if: needs.update-module.outputs.output1 == 'true'
118+
# runs-on: ubuntu-latest
119+
# steps:
120+
# - uses: actions/checkout@v3
121+
# with:
122+
# token: ${{ secrets.PAT }}
123+
# repository: aaronparker/vcredist
124+
125+
# - name: Git pull
126+
# id: pull
127+
# shell: pwsh
128+
# run: |
129+
# git pull origin main
130+
131+
# - name: Get module version number
132+
# id: get-version
133+
# shell: pwsh
134+
# run: |
135+
# $manifestPath = "${{ github.workspace }}/VcRedist/VcRedist.psd1"
136+
# $manifest = Test-ModuleManifest -Path $manifestPath
137+
# Write-Host "Found version: $($manifest.Version)"
138+
# echo "::set-output name=version::$($manifest.Version)"
139+
140+
# # Import GPG key so that we can sign the commit
141+
# - name: Import GPG key
142+
# id: import_gpg
143+
# uses: crazy-max/ghaction-import-gpg@v5
144+
# with:
145+
# gpg_private_key: ${{ secrets.GPGKEY }}
146+
# passphrase: ${{ secrets.GPGPASSPHRASE }}
147+
# git_user_signingkey: true
148+
# git_commit_gpgsign: true
149+
# git_config_global: true
150+
# git_tag_gpgsign: true
151+
# git_push_gpgsign: false
152+
# git_committer_name: ${{ secrets.COMMIT_NAME }}
153+
# git_committer_email: ${{ secrets.COMMIT_EMAIL }}
154+
155+
# # Push tag
156+
# - name: Push tag
157+
# shell: bash
158+
# run: |
159+
# git tag -a "v${{steps.get-version.outputs.version}}" -m "v${{steps.get-version.outputs.version}}"
160+
# git push origin "v${{steps.get-version.outputs.version}}"

ci/Push-Tag.ps1

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<#
2+
.SYNOPSIS
3+
Set a tag and push
4+
#>
5+
[CmdletBinding()]
6+
param()
7+
8+
$Path = Resolve-Path -Path (((Get-Item (Split-Path -Parent -Path $MyInvocation.MyCommand.Definition)).Parent).FullName)
9+
$Module = Test-ModuleManifest -Path "$Path/VcRedist/VcRedist.psd1"
10+
if ($null -ne $Module) {
11+
git tag "v$($Module.Version.ToString())"
12+
git push origin --tags
13+
}

0 commit comments

Comments
 (0)