Skip to content

Commit

Permalink
Merge pull request #1061 from mountaindude/docker-build
Browse files Browse the repository at this point in the history
build: Debug Docker image bulild code
  • Loading branch information
mountaindude authored Apr 8, 2024
2 parents c1d518a + c9748e1 commit 11480d8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
34 changes: 19 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
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 @@ -113,6 +114,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 @@ -173,20 +175,20 @@ jobs:
# - ./src/config⁄production_template.yaml
# - ./src/config⁄schedule_template.yaml
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"

cd src
zip -u -r "../${DIST_FILE_NAME}-${{ needs.release-please.outputs.release_tag_name }}-macos.zip" "./config/email_templates" "./config/slack_templates" "./config/teams_templates" "./config/production_template.yaml" "./config/schedule_template.yaml" "./config/log_appender_xml" -x "*.DS_Store"
zip -u -r "../${DIST_FILE_NAME}-${{ needs.release-please.outputs.release_version }}-macos.zip" "./config/email_templates" "./config/slack_templates" "./config/teams_templates" "./config/production_template.yaml" "./config/schedule_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 @@ -200,8 +202,8 @@ jobs:
artifactContentType: raw
# artifactContentType: application/zip
draft: true
tag: ${{ needs.release-please.outputs.release_tag_name }}
artifacts: ./butler-${{ needs.release-please.outputs.release_tag_name }}-macos.zip
tag: ${{ needs.release-please.outputs.release_version }}
artifacts: ./butler-${{ needs.release-please.outputs.release_version }}-macos.zip
token: ${{ github.token }}

- name: Tidy up before existing
Expand All @@ -210,7 +212,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 @@ -233,6 +235,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 @@ -302,7 +305,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 Down Expand Up @@ -332,16 +335,16 @@ jobs:
artifactContentType: raw
# artifactContentType: application/zip
draft: true
tag: ${{ needs.release-please.outputs.release_tag_name }}
artifacts: ./butler-${{ needs.release-please.outputs.release_tag_name }}-win.zip
tag: ${{ needs.release-please.outputs.release_version }}
artifacts: ./butler-${{ 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 "./${{ needs.release-please.outputs.release_version }}-win.zip"
release-linux:
needs: release-please
Expand All @@ -356,6 +359,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 @@ -399,10 +403,10 @@ jobs:
# - ./src/config⁄schedule_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 "./${{ 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/email_templates" "./config/slack_templates" "./config/teams_templates" "./config/production_template.yaml" "./config/schedule_template.yaml" "./config/log_appender_xml"
zip -9 -u -r "../${{ needs.release-please.outputs.release_version }}-linux.zip" "./config/email_templates" "./config/slack_templates" "./config/teams_templates" "./config/production_template.yaml" "./config/schedule_template.yaml" "./config/log_appender_xml"
cd ..
- name: Debug
Expand All @@ -418,8 +422,8 @@ jobs:
artifactContentType: raw
# artifactContentType: application/zip
draft: true
tag: ${{ needs.release-please.outputs.release_tag_name }}
artifacts: ./butler-${{ needs.release-please.outputs.release_tag_name }}-linux.zip
tag: ${{ needs.release-please.outputs.release_version }}
artifacts: ./${{ needs.release-please.outputs.release_version }}-linux.zip
token: ${{ github.token }}

- name: Tidy up before existing
Expand All @@ -428,4 +432,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"
9 changes: 5 additions & 4 deletions .github/workflows/docker-image-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,13 @@ jobs:
# Store the tag in GITHUB_ENV environment variable
- name: Create clean tag for Docker
run: |
export TAGTMP1=${{ github.ref }}
export TAG=${TAGTMP1##*/}
#export TAG=$(echo ${{ github.ref }} | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' | cut -c 2-)
#export TAGTMP1=${{ github.ref }}
#export TAG=${TAGTMP1##*/}
export TAG=$(echo ${{ github.ref }} | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' | cut -c 2-)
echo "TAG=$TAG" >> $GITHUB_ENV
#
# Debug
echo "TAGTMP1=$TAGTMP1"
# echo "TAGTMP1=$TAGTMP1"
echo "TAG=$TAG"
echo "GITHUB_ENV=$GITHUB_ENV"
# export TAGTMP2=${TAGTMP1##*/}
Expand Down

0 comments on commit 11480d8

Please sign in to comment.