Skip to content

Commit

Permalink
fix: Fix incorrect zip file names for pre-compiled binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
Göran Sander committed Apr 9, 2024
1 parent acb40a1 commit f506ce1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
32 changes: 18 additions & 14 deletions .github/workflows/ci.yaml
Expand Up @@ -10,6 +10,7 @@ jobs:
outputs:
releases_created: ${{ steps.release.outputs.releases_created }}
release_tag_name: ${{ steps.release.outputs['tag_name'] }}
release_version: ${{ steps.release.outputs['version'] }}
release_upload_url: ${{ steps.release.outputs['upload_url'] }}
env:
GITHUB_REF: ${{ github.ref }}
Expand Down Expand Up @@ -75,6 +76,7 @@ jobs:
- name: Release tag and upload url from previous job
run: |
echo "tag_name : ${{ needs.release-please.outputs.release_tag_name }}"
echo "version : ${{ needs.release-please.outputs.release_version }}"
echo "upload_url : ${{ needs.release-please.outputs.release_upload_url }}"
- name: Checkout repository
Expand Down Expand Up @@ -128,21 +130,21 @@ jobs:

# Notarize release binary
echo "Creating temp notarization archive for release binary"
zip -r "./${DIST_FILE_NAME}-${{ needs.release-please.outputs.release_tag_name }}-macos.zip" "./${DIST_FILE_NAME}" -x "*.DS_Store"
zip -r "./${DIST_FILE_NAME}-${{ needs.release-please.outputs.release_version }}-macos.zip" "./${DIST_FILE_NAME}" -x "*.DS_Store"
## ditto -c -k --keepParent "./${DIST_FILE_NAME}" "./${DIST_FILE_NAME}.zip"
#ditto -c -k --keepParent "./${DIST_FILE_NAME}" "./${DIST_FILE_NAME}-${{ needs.release-please.outputs.release_tag_name }}-macos.zip"
#ditto -c -k --keepParent "./${DIST_FILE_NAME}" "./${DIST_FILE_NAME}-${{ needs.release-please.outputs.release_version }}-macos.zip"

# Add additional files to the zip file
cd src
zip -u -r "../${DIST_FILE_NAME}-${{ needs.release-please.outputs.release_tag_name }}-macos.zip" "./config/production_template.yaml" "./config/log_appender_xml" -x "*.DS_Store"
zip -u -r "../${DIST_FILE_NAME}-${{ needs.release-please.outputs.release_version }}-macos.zip" "./config/production_template.yaml" "./config/log_appender_xml" -x "*.DS_Store"
cd ..

# Here we send the notarization request to the Apple's Notarization service, waiting for the result.
# This typically takes a few seconds inside a CI environment, but it might take more depending on the App
# characteristics. Visit the Notarization docs for more information and strategies on how to optimize it if
# you're curious
echo "Notarize release app"
xcrun notarytool submit "./${DIST_FILE_NAME}-${{ needs.release-please.outputs.release_tag_name }}-macos.zip" --keychain-profile "notarytool-profile" --wait
xcrun notarytool submit "./${DIST_FILE_NAME}-${{ needs.release-please.outputs.release_version }}-macos.zip" --keychain-profile "notarytool-profile" --wait

# Delete build keychain
security delete-keychain build.keychain
Expand All @@ -157,7 +159,7 @@ jobs:
# artifactContentType: application/zip
draft: true
tag: ${{ needs.release-please.outputs.release_tag_name }}
artifacts: ./butler-sos-${{ needs.release-please.outputs.release_tag_name }}-macos.zip
artifacts: ./butler-sos-${{ needs.release-please.outputs.release_version }}-macos.zip
token: ${{ github.token }}

- name: Tidy up before existing
Expand All @@ -166,7 +168,7 @@ jobs:
ls -la
rm build.cjs
rm "./${DIST_FILE_NAME}"
rm "./${DIST_FILE_NAME}-${{ needs.release-please.outputs.release_tag_name }}-macos.zip"
rm "./${DIST_FILE_NAME}-${{ needs.release-please.outputs.release_version }}-macos.zip"
release-win64:
needs: release-please
Expand All @@ -189,6 +191,7 @@ jobs:
- name: Release tag and upload url from previous job
run: |
Write-Output 'tag_name : ${{ needs.release-please.outputs.release_tag_name }}'
Write-Output 'version : ${{ needs.release-please.outputs.release_version }}'
Write-Output 'upload_url : ${{ needs.release-please.outputs.release_upload_url }}'
- name: Checkout repository
Expand Down Expand Up @@ -257,7 +260,7 @@ jobs:
$compress = @{
Path = "./${env:DIST_FILE_NAME}.exe"
CompressionLevel = "Fastest"
DestinationPath = "${env:DIST_FILE_NAME}-${{ needs.release-please.outputs.release_tag_name }}-win.zip"
DestinationPath = "${env:DIST_FILE_NAME}-${{ needs.release-please.outputs.release_version }}-win.zip"
}
Compress-Archive @compress
Expand All @@ -268,7 +271,7 @@ jobs:
Copy-Item -Path ./src/config/log_appender_xml -Destination ./config/ -Recurse
Copy-Item -Path ./src/config/production_template.yaml -Destination ./config/
Compress-Archive -Path "./config" -Update -DestinationPath "./${env:DIST_FILE_NAME}-${{ needs.release-please.outputs.release_tag_name }}-win.zip"
Compress-Archive -Path "./config" -Update -DestinationPath "./${env:DIST_FILE_NAME}-${{ needs.release-please.outputs.release_version }}-win.zip"
- name: Upload to existing release
uses: ncipollo/release-action@v1
Expand All @@ -280,15 +283,15 @@ jobs:
# artifactContentType: application/zip
draft: true
tag: ${{ needs.release-please.outputs.release_tag_name }}
artifacts: ./butler-sos-${{ needs.release-please.outputs.release_tag_name }}-win.zip
artifacts: ./butler-sos-${{ needs.release-please.outputs.release_version }}-win.zip
token: ${{ github.token }}

- name: Tidy up before existing
run: |
dir
del build.cjs
del "./${env:DIST_FILE_NAME}.exe"
del "./${env:DIST_FILE_NAME}-${{ needs.release-please.outputs.release_tag_name }}-win.zip"
del "./${env:DIST_FILE_NAME}-${{ needs.release-please.outputs.release_version }}-win.zip"
release-linux:
needs: release-please
Expand All @@ -303,6 +306,7 @@ jobs:
- name: Release tag and upload url from previous job
run: |
echo "tag_name : ${{ needs.release-please.outputs.release_tag_name }}"
echo "version : ${{ needs.release-please.outputs.release_version }}"
echo "upload_url : ${{ needs.release-please.outputs.release_upload_url }}"
- name: Checkout repository
Expand Down Expand Up @@ -342,10 +346,10 @@ jobs:
# - ./src/config⁄production_template.yaml
ls -la
zip -9 -r ./${DIST_FILE_NAME}-${{ needs.release-please.outputs.release_tag_name }}-linux.zip ${DIST_FILE_NAME}
zip -9 -r ./${DIST_FILE_NAME}-${{ needs.release-please.outputs.release_version }}-linux.zip ${DIST_FILE_NAME}
cd src
zip -9 -u -r "../${DIST_FILE_NAME}-${{ needs.release-please.outputs.release_tag_name }}-linux.zip" "./config/production_template.yaml" "./config/log_appender_xml"
zip -9 -u -r "../${DIST_FILE_NAME}-${{ needs.release-please.outputs.release_version }}-linux.zip" "./config/production_template.yaml" "./config/log_appender_xml"
- name: Debug
run: |
Expand All @@ -361,7 +365,7 @@ jobs:
# artifactContentType: application/zip
draft: true
tag: ${{ needs.release-please.outputs.release_tag_name }}
artifacts: ./butler-sos-${{ needs.release-please.outputs.release_tag_name }}-linux.zip
artifacts: ./butler-sos-${{ needs.release-please.outputs.release_version }}-linux.zip
token: ${{ github.token }}

- name: Tidy up before existing
Expand All @@ -370,4 +374,4 @@ jobs:
ls -la
rm build.cjs
rm "./${DIST_FILE_NAME}"
rm "./${DIST_FILE_NAME}-${{ needs.release-please.outputs.release_tag_name }}-linux.zip"
rm "./${DIST_FILE_NAME}-${{ needs.release-please.outputs.release_version }}-linux.zip"
10 changes: 8 additions & 2 deletions .github/workflows/docker-image-build.yaml
Expand Up @@ -79,9 +79,15 @@ jobs:
# Store the tag in GITHUB_ENV environment variable
- name: Create clean tag for Docker
run: |
export TAGTMP1=${{ github.ref }}
export TAG=${TAGTMP1##*/}
#export TAGTMP1=${{ github.ref }}
#export TAG=${TAGTMP1##*/}
export TAG=$(echo ${{ github.ref }} | grep -oP 'v\d+\.\d+\.\d+')
echo "TAG=$TAG" >> $GITHUB_ENV
#
# Debug
# echo "TAGTMP1=$TAGTMP1"
echo "TAG=$TAG"
echo "GITHUB_ENV=$GITHUB_ENV"
# export TAGTMP2=${TAGTMP1##*/}
# export TAG=${TAGTMP2##*-}
# echo "TAG=$TAG" >> $GITHUB_ENV
Expand Down

0 comments on commit f506ce1

Please sign in to comment.