Comment Action for Release Deployment

This commit is contained in:
local-script 2025-05-16 14:52:41 +02:00
commit 029a0beceb

View file

@ -66,71 +66,61 @@ jobs:
name: drop name: drop
path: ${{ github.workspace }}/artifacts path: ${{ github.workspace }}/artifacts
deploy: # deploy:
runs-on: windows-latest # runs-on: windows-latest
needs: build # needs: build
#
steps: # steps:
#
- name: Checkout repository # - name: Checkout repository
uses: actions/checkout@v2 # uses: actions/checkout@v2
with: # with:
fetch-depth: 0 # fetch-depth: 0
#
- name: Download build artifacts # - name: Download build artifacts
uses: actions/download-artifact@v4 # uses: actions/download-artifact@v4
with: # with:
name: drop # Name of the artifact uploaded in previous steps # name: drop Name of the artifact uploaded in previous steps
path: drop # Local folder where artifacts are downloaded # path: drop Local folder where artifacts are downloaded
#
- name: Extract version from file name # - name: Extract version from file name
id: extract_version # id: extract_version
run: | # run: |
$file = Get-ChildItem drop -Filter "Greenshot-INSTALLER-*.exe" | Select-Object -First 1 # $file = Get-ChildItem drop -Filter "Greenshot-INSTALLER-*.exe" | Select-Object -First 1
if (-not $file) { # if (-not $file) {
throw "No matching file found in 'drop' directory." # throw "No matching file found in 'drop' directory."
} # }
if ($file.Name -match "Greenshot-INSTALLER-([\d\.]+).*\.exe") { # if ($file.Name -match "Greenshot-INSTALLER-([\d\.]+).*\.exe") {
echo "version=$($matches[1])" >> $Env:GITHUB_OUTPUT # echo "version=$($matches[1])" >> $Env:GITHUB_OUTPUT
} else { # } else {
throw "Version number could not be extracted from file name: $($file.Name)" # throw "Version number could not be extracted from file name: $($file.Name)"
} # }
shell: pwsh # shell: pwsh
#
- name: Create tag # - name: Create tag
run: | # run: |
git config user.name "github-actions[bot]" # git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com" # git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "v${{ steps.extract_version.outputs.version }}" -m "v${{ steps.extract_version.outputs.version }}" # git tag -a "v${{ steps.extract_version.outputs.version }}" -m "v${{ steps.extract_version.outputs.version }}"
git push origin "v${{ steps.extract_version.outputs.version }}" # git push origin "v${{ steps.extract_version.outputs.version }}"
#
- name: Create GitHub Release # - name: Create GitHub Release
uses: softprops/action-gh-release@v2 # uses: softprops/action-gh-release@v2
with: # with:
name: "Greenshot ${{ steps.extract_version.outputs.version }} unstable" # name: "Greenshot ${{ steps.extract_version.outputs.version }} unstable"
tag_name: "v${{ steps.extract_version.outputs.version }}" # tag_name: "v${{ steps.extract_version.outputs.version }}"
files: drop/*.exe # files: drop/*.exe
generate_release_notes: true # generate_release_notes: true
draft: true # draft: true
prerelease: true # prerelease: true
env: # env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#
- name: Trigger GitHub Pages rebuild # - name: Trigger GitHub Pages rebuild
shell: bash # shell: bash
run: | # run: |
curl -X POST \ # curl -X POST \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ # -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github+json" \ # -H "Accept: application/vnd.github+json" \
https://api.github.com/repos/${{ github.repository }}/pages/builds # https://api.github.com/repos/${{ github.repository }}/pages/builds
# TODOs
# [ ] code signing (setup.iss / innosetup)
# [x] name of release
# [x] version tag
# [x] change log (?) (release-drafter action)
# [x] update gh-pages automatically (?)