Skip to content

Commit

Permalink
added release
Browse files Browse the repository at this point in the history
  • Loading branch information
matt2005 committed Jan 8, 2023
1 parent bf97a35 commit 570f6b8
Showing 1 changed file with 29 additions and 17 deletions.
46 changes: 29 additions & 17 deletions .github/workflows/build_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@ on:
- 'releases/**'
workflow_dispatch:
inputs:
version:
description: 'Version'
release:
description: 'Release Version'
jobs:
version:
outputs:
version: ${{ steps.get_version.outputs.version }}
release: ${{ steps.get_version.outputs.release }}
runs-on: "ubuntu-latest"
steps:
-
name: Get the version
name: Get the release version
id: get_version
run: |
if [ -z "$version" ]
if [ -z "$release" ]
then
version=$(date '+%Y%m%d')
echo version="${version}" >> $GITHUB_OUTPUT
release=$(date '+%Y%m%d')
echo release="${release}" >> $GITHUB_OUTPUT
else
echo version="${version}" >> $GITHUB_OUTPUT
echo release="${release}" >> $GITHUB_OUTPUT
fi
env:
version: ${{ github.event.inputs.version }}
release: ${{ github.event.inputs.release }}
build:
runs-on: ${{ matrix.host }}
needs: [ version ]
Expand Down Expand Up @@ -71,9 +71,10 @@ jobs:
then
osname=${ostype}_${osname}
fi
echo version="${version}-${osname}-${arch}" >> $GITHUB_OUTPUT
echo version="${release}-${osname}-${arch}" >> $GITHUB_OUTPUT
echo release="${release}" >> $GITHUB_OUTPUT
env:
version: ${{needs.version.outputs.version }}
release: ${{needs.version.outputs.release }}
arch: ${{ matrix.config.arch }}
ostype: ${{ matrix.config.ostype }}
osname: ${{ matrix.config.osname }}
Expand Down Expand Up @@ -114,7 +115,7 @@ jobs:
id: upload_deploy
uses: actions/upload-artifact@v3
with:
name: ${{ steps.get_version.outputs.version }}
name: ${{ steps.get_version.outputs.release }}
path: |
${{ steps.packagezip.outputs.ZIP_FILENAME }}
${{ steps.packagezip.outputs.MD5ZIPHASHFILE }}
Expand Down Expand Up @@ -172,25 +173,26 @@ jobs:
then
osname=${ostype}_${osname}
fi
echo version="${version}-${osname}-${arch}" >> $GITHUB_OUTPUT
echo version="${release}-${osname}-${arch}" >> $GITHUB_OUTPUT
echo release="${release}" >> $GITHUB_OUTPUT
env:
version: ${{needs.version.outputs.version }}
release: ${{needs.version.outputs.release }}
arch: ${{ matrix.config.arch }}
osname: ${{ matrix.config.osname }}
ostype: ${{ matrix.config.ostype }}
-
name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: ${{ steps.get_version.outputs.version }}
name: ${{ steps.get_version.outputs.release }}
-
name: Upload zip to release
id: upload_zip
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
name: ${{ steps.get_version.outputs.version }}
tag_name: ${{ steps.get_version.outputs.version }}
name: ${{ steps.get_version.outputs.release }}
tag_name: ${{ steps.get_version.outputs.release }}
files: opendsh-${{ steps.get_version.outputs.version }}.zip
append_body: true
draft: true
Expand All @@ -204,3 +206,13 @@ jobs:
echo ${MD5_ZIPHASH}
echo ZIP_FILENAME="${ZIP_FILENAME}" >> $GITHUB_OUTPUT
echo MD5_ZIPHASH="${MD5_ZIPHASH}" >> $GITHUB_OUTPUT
-
name: Append hashes to release
id: append_hashes_to_release
uses: softprops/action-gh-release@v1
with:
name: ${{ steps.get_version.outputs.release }}
tag_name: ${{ steps.get_version.outputs.release }}
body: "ZIP: ${{ steps.filehashes.outputs.ZIP_FILENAME }} MD5 Hash: ${{ steps.filehashes.outputs.MD5_ZIPHASH }}"
append_body: true
draft: true

0 comments on commit 570f6b8

Please sign in to comment.