Skip to content

Commit

Permalink
adding short hash to artifact filename except macos.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsm committed Nov 25, 2024
1 parent 2441e1d commit d141a22
Showing 1 changed file with 58 additions and 33 deletions.
91 changes: 58 additions & 33 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ jobs:
- name: Read version from file
id: read_version
run: |
if [ "${{github.ref_type}}" == "tag" ]; then
if [ "${{ github.ref_type }}" == "tag" ]; then
VERSION=${{ github.ref_name }}
else
SHORT_HASH=""
else
MAJOR_MINOR=$(cut -d. -f1-2 VERSION)
VERSION="${MAJOR_MINOR}.99"
# Get the short hash of the current commit
SHORT_HASH=$(echo ${{ github.sha }} | cut -c1-7)
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "version=$VERSION" >> $GITHUB_OUTPUT
# Get the short hash of the current commit
SHORT_HASH=$(git rev-parse --short=8 HEAD)
echo "SHORT_HASH=$SHORT_HASH" >> $GITHUB_ENV
echo "short_hash=$SHORT_HASH" >> $GITHUB_OUTPUT
Expand All @@ -63,10 +63,14 @@ jobs:
submodules: recursive

- name: Set version environment variable
run: echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV
run: |
echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV
echo "SHORT_HASH=${{ needs.setup.outputs.short_hash }}" >> $GITHUB_ENV
- name: Print version
run: echo "Qucs-S version is ${{ env.VERSION }}"
- name: Print version and hash
run: |
echo "Qucs-S version is ${{ env.VERSION }}"
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}"
- name: Install Dependencies
run: |
Expand Down Expand Up @@ -106,10 +110,14 @@ jobs:
submodules: recursive

- name: Set version environment variable
run: echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV
run: |
echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV
echo "SHORT_HASH=${{ needs.setup.outputs.short_hash }}" >> $GITHUB_ENV
- name: Print version
run: echo "Qucs-S version is ${{ env.VERSION }}"
- name: Print version and hash
run: |
echo "Qucs-S version is ${{ env.VERSION }}"
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}"
- name: Install Dependencies
run: |
Expand Down Expand Up @@ -161,13 +169,13 @@ jobs:
--plugin=qt --output appimage
rm linuxdeploy-x86_64.AppImage
rm linuxdeploy-plugin-qt-x86_64.AppImage
mv *.AppImage ${{ env.APP_NAME }}-${{env.VERSION}}-linux-x86_64.AppImage
mv *.AppImage ${{ env.APP_NAME }}-${{env.VERSION}}-${{env.SHORT_HASH}}-linux-x86_64.AppImage
- name: 'Upload artifact: AppImage'
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP_NAME }}-${{env.VERSION}}-linux-x86_64
path: ${{ env.APP_NAME }}-${{env.VERSION}}-linux-x86_64.AppImage
name: ${{ env.APP_NAME }}-${{env.VERSION}}-${{env.SHORT_HASH}}-linux-x86_64
path: ${{ env.APP_NAME }}-${{env.VERSION}}-${{env.SHORT_HASH}}-linux-x86_64.AppImage


build-mac-intel:
Expand All @@ -181,10 +189,14 @@ jobs:
xcode-version: latest-stable

- name: Set version environment variable
run: echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV
run: |
echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV
echo "SHORT_HASH=${{ needs.setup.outputs.short_hash }}" >> $GITHUB_ENV
- name: Print version
run: echo "Qucs-S version is ${{ env.VERSION }}"
- name: Print version and hash
run: |
echo "Qucs-S version is ${{ env.VERSION }}"
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}"
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -273,10 +285,14 @@ jobs:
xcode-version: latest-stable

- name: Set version environment variable
run: echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV
run: |
echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV
echo "SHORT_HASH=${{ needs.setup.outputs.short_hash }}" >> $GITHUB_ENV
- name: Print version
run: echo "Qucs-S version is ${{ env.VERSION }}"
- name: Print version and hash
run: |
echo "Qucs-S version is ${{ env.VERSION }}"
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}"
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -370,10 +386,12 @@ jobs:
- name: Set version environment variable
run: |
echo "VERSION=${{ needs.setup.outputs.version }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "SHORT_HASH=${{ needs.setup.outputs.short_hash }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Print version
- name: Print version and hash
run: |
echo "Qucs-S version is ${{ env.VERSION }}"
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}"
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -430,10 +448,13 @@ jobs:
shell: pwsh
run: |
echo "VERSION=${{ needs.setup.outputs.version }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "SHORT_HASH=${{ needs.setup.outputs.short_hash }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Print version
- name: Print version and hash
shell: pwsh
run: echo "Qucs-S version is ${{ env.VERSION }}"
run: |
echo "Qucs-S version is ${{ env.VERSION }}"
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}"
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -514,26 +535,26 @@ jobs:
mkdir -p build/qucs-suite/misc
cp -rf contrib/InnoSetup/misc build/qucs-suite/
cd build/qucs-suite
zip -r ../../${{ env.APP_NAME }}-${{ env.VERSION }}-win64.zip ./bin ./share ./lib ./misc
zip -r ../../${{ env.APP_NAME }}-${{ env.VERSION }}-${{ env.SHORT_HASH }}-win64.zip ./bin ./share ./lib ./misc
cd ../..
- name: Compile .ISS to .EXE Installer
uses: Minionguyjpro/[email protected].4
uses: Minionguyjpro/[email protected].5
with:
path: contrib/InnoSetup/qucs.iss
options: /Qp /O"${{github.workspace}}" /DAPPNAME=${{ env.APP_NAME }} /DRELEASE="${{ env.VERSION }}"
options: /Qp /O"${{github.workspace}}" /DAPPNAME=${{ env.APP_NAME }} /DRELEASE="${{ env.VERSION }}-${{ env.SHORT_HASH }}"

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP_NAME }}-${{ env.VERSION }}-win64
path: ${{ env.APP_NAME }}-${{ env.VERSION }}-win64.zip
name: ${{ env.APP_NAME }}-${{ env.VERSION }}-${{ env.SHORT_HASH }}-win64
path: ${{ env.APP_NAME }}-${{ env.VERSION }}-${{ env.SHORT_HASH }}-win64.zip

- name: Upload exe artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP_NAME }}-${{ env.VERSION }}-setup
path: ${{ env.APP_NAME }}-${{ env.VERSION }}-setup.exe
name: ${{ env.APP_NAME }}-${{ env.VERSION }}-${{ env.SHORT_HASH }}-setup
path: ${{ env.APP_NAME }}-${{ env.VERSION }}-${{ env.SHORT_HASH }}-setup.exe

create-release:
runs-on: ubuntu-latest
Expand All @@ -544,10 +565,14 @@ jobs:
uses: actions/checkout@v4

- name: Set version environment variable
run: echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV
run: |
echo "VERSION=${{ needs.setup.outputs.version }}" >> $GITHUB_ENV
echo "SHORT_HASH=${{ needs.setup.outputs.short_hash }}" >> $GITHUB_ENV
- name: Print version
run: echo "Qucs-S version is ${{ env.VERSION }}"
- name: Print version and hash
run: |
echo "Qucs-S version is ${{ env.VERSION }}"
echo "Qucs-S short hash is ${{ env.SHORT_HASH }}"
- name: Download build artifacts
uses: actions/download-artifact@v4
Expand Down

0 comments on commit d141a22

Please sign in to comment.