Skip to content

Commit

Permalink
use GoReleaserPro
Browse files Browse the repository at this point in the history
  • Loading branch information
lionello committed Jun 27, 2024
1 parent 41d1932 commit ddb3854
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/check-sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Check for required files
run: |
Expand All @@ -37,14 +37,14 @@ jobs:
- [ ] I have documented how to provision any third-party services in the readme
- [ ] I have documented how to run the sample in the readme (locally and with Defang)
`;
// Get the current PR
const { data: pullRequest } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pr_number
});
// Check if the checklist already exists in the PR description
if (!pullRequest.body.includes(checklist)) {
// Update the PR description with the checklist
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,12 @@ jobs:
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
# distribution: goreleaser-pro # either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser-pro # either 'goreleaser' (default) or 'goreleaser-pro'
# version: latest
args: release --clean
workdir: src
env:
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
GH_PAT_WINGET: ${{ secrets.GH_PAT_WINGET }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GITHUB_TOKEN is limited to the current repository
MACOS_CERTIFICATE_NAME: ${{ secrets.MACOS_CERTIFICATE_NAME }}
Expand All @@ -158,7 +159,7 @@ jobs:
- name: Notarize macOS app
shell: bash
run: |
xcrun notarytool submit src/dist/defang_*_macOS.zip --apple-id "$MACOS_NOTARIZATION_APPLE_ID" --team-id "$MACOS_NOTARIZATION_TEAM_ID" --password "$MACOS_NOTARIZATION_APP_PW"
bin/notarize.sh src/dist/defang_*_macOS.zip
env:
MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.MACOS_NOTARIZATION_APPLE_ID }}
MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.MACOS_NOTARIZATION_TEAM_ID }}
Expand Down Expand Up @@ -187,7 +188,7 @@ jobs:
client-payload: '{"version": "${{ github.ref_name }}"}'

- name: Trigger Homebrew Formula Update
uses: peter-evans/repository-dispatch@v1
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.HOMEBREW_ACTION_TRIGGER_TOKEN }}
repository: DefangLabs/homebrew-defang
Expand Down Expand Up @@ -215,7 +216,7 @@ jobs:
# install dependencies
npm ci --ignore-scripts
#b uild
# build
npm run build
# make the cli.js executable
Expand Down
27 changes: 27 additions & 0 deletions src/bin/notarize.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh
set -e

# Bail if we didn't get one (and only one) argument
if [ $# -ne 1 ]; then
echo "Usage: $0 <path to app to notarize>"
exit 1
fi

if [ -z "$MACOS_NOTARIZATION_APPLE_ID" ]; then
echo "Error: missing env var MACOS_NOTARIZATION_APPLE_ID"
exit 2
fi

if [ -z "$MACOS_NOTARIZATION_TEAM_ID" ]; then
echo "Error: missing env var MACOS_NOTARIZATION_TEAM_ID"
exit 3
fi

if [ -z "$MACOS_NOTARIZATION_APP_PW" ]; then
echo "Error: missing env var MACOS_NOTARIZATION_APP_PW"
exit 4
fi

[ "$ACTIONS_STEP_DEBUG" = 'true' ] || [ "$DEBUG" = 'true' ] && set -x

xcrun notarytool submit "$1" --apple-id "$MACOS_NOTARIZATION_APPLE_ID" --team-id "$MACOS_NOTARIZATION_TEAM_ID" --password "$MACOS_NOTARIZATION_APP_PW"

0 comments on commit ddb3854

Please sign in to comment.