-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create rerelease.yml Adds a workflow to re-release assets for existing releases. Signed-off-by: lemccomb <117306942+lemccomb@users.noreply.github.com> * Update changelog for release --------- Signed-off-by: lemccomb <117306942+lemccomb@users.noreply.github.com> Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
f653363
commit 4227ef0
Showing
2 changed files
with
163 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
#### Re-release Assets #### | ||
# This workflow exists solely to replace the zip files on existing releases, and should only be run manually. | ||
# It updates all of the releases in the given range. | ||
|
||
name: Re-release Assets | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
oldest: | ||
description: 'Oldest release to include' | ||
required: true | ||
default: 'v0.3.1' | ||
newest: | ||
description: 'Newest release to include' | ||
required: true | ||
default: 'current' | ||
|
||
jobs: | ||
release_assets_by_tag: | ||
name: release-assets | ||
runs-on: ${{ matrix.os }} | ||
permissions: | ||
actions: write | ||
contents: write | ||
deployments: write | ||
packages: write | ||
pull-requests: write | ||
security-events: write | ||
statuses: write | ||
strategy: | ||
matrix: | ||
include: | ||
- os: windows-latest | ||
dir_command: gci -Recurse | ||
zip_command_debug: Compress-Archive -Path ./debug/ -DestinationPath CoseSignTool-Windows-debug.zip | ||
zip_command_release: Compress-Archive -Path ./release/ -DestinationPath CoseSignTool-Windows-release.zip | ||
- os: ubuntu-latest | ||
dir_command: ls -a -R | ||
zip_command_debug: zip -r CoseSignTool-Linux-debug.zip ./debug/ | ||
zip_command_release: zip -r CoseSignTool-Linux-release.zip ./release/ | ||
- os: macos-latest | ||
dir_command: ls -a -R | ||
zip_command_debug: zip -r CoseSignTool-MacOS-debug.zip ./debug/ | ||
zip_command_release: zip -r CoseSignTool-MacOS-release.zip ./release/ | ||
|
||
steps: | ||
# Checkout the branch. | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get list of tags | ||
run: | | ||
oldest=${{ github.event.inputs.oldest }} | ||
newest=${{ github.event.inputs.newest }} | ||
tags=$(git tag --sort=creatordate "$oldest".."$newest") | ||
echo "tagsToUpdate=[$(echo $tags | tr ' ' ',')]" >> $GITHUB_ENV | ||
- name: Release assets for selected tags | ||
run: | | ||
for tag in ${{ env.tagsToUpdate }}; do | ||
echo "**** Release $tag ****\n******************************\n" | ||
# Run checkout action | ||
echo "::group::Checkout" | ||
echo "Checkout tagged release" | ||
- name: Checkout tagged release | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: $tag | ||
echo "::endgroup::" | ||
# Build and publish the binaries to ./published. | ||
echo "::group::Publish" | ||
echo "Build and publish" | ||
dotnet publish --configuration Debug --self-contained true --output published/debug CoseSignTool/CoseSignTool.csproj | ||
dotnet publish --configuration Release --self-contained true --output published/release CoseSignTool/CoseSignTool.csproj | ||
# Self-contained is needed. Must use .csproj instead of .sln. | ||
echo "::endgroup::" | ||
# Copy the docs, license, and markdown files to the release folders. | ||
echo "::group::Copy" | ||
echo "Copy documentation" | ||
for folder in debug release; do | ||
mkdir -p published/$folder/docs | ||
cp -r docs/* published/$folder/docs/ | ||
cp -r LICENSE published/$folder/ | ||
cp -r *.md published/$folder/ | ||
done | ||
echo "::endgroup::" | ||
# Create zip files for release. | ||
echo "::group::Zips" | ||
echo "Create zip files for the release" | ||
${{ matrix.zip_command_debug }} | ||
${{ matrix.zip_command_release }} | ||
${{ matrix.dir_command }} | ||
echo "::endgroup::" | ||
# Upload the zipped assets to the release. | ||
echo "::group::Upload" | ||
echo "Upload .zip files to Github" | ||
- name: Upload artifacts | ||
id: upload | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: ./published/CoseSignTool-*.zip | ||
file_glob: true | ||
overwrite: true | ||
tag: ${{ needs.create_release.outputs.tag_name }} | ||
echo "::endgroup::" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters