Skip to content

Commit 237f257

Browse files
committed
Always build dmg installer in CI
Given that building a dmg is fast, just always build it instead of only doing so when doing a release. This allows a user to download fixes and new features quickly to test it out locally. Note that the dmg will be unsigned, however, and not officially blessed by the team. This is essentially a nightly build for the project. Add a sane upper limit to retention days for dev builds, just in case we end up making a lot of artifacts this way (since we are doing this per every commit to master now). Also, remove the previous "--skip-jenkins" hack we passed to create-dmg. It was necessary in previous runners due to permission issues but it seems like new GitHub Actions images have relaxed on that so the script runs without that flag now. This allows us to beautify the dmg image in CI.
1 parent 964fd9a commit 237f257

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

.github/workflows/ci-macvim.yaml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -384,27 +384,35 @@ jobs:
384384
make ${MAKE_BUILD_ARGS} -C src/testdir clean
385385
make ${MAKE_BUILD_ARGS} -C src testgui
386386
387-
# Creates a DMG package of MacVim. Note that this doesn't create a GitHub release for us, because we would prefer to
388-
# do it manually, for two reasons: 1) signing / notarization are currently done out of CI, 2) we want to manually
389-
# format our release notes and add pictures to make them look nice.
390387
- name: Build MacVim dmg image
391-
if: startsWith(github.ref, 'refs/tags/') && matrix.publish
388+
if: matrix.publish && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master')
392389
run: |
393390
# Use the --skip-jenkins flag to skip the prettify osascript calls which could fail due to permission issues in
394391
# CI environment.
395392
if ${{ matrix.legacy == true }}; then
396-
make -C src macvim-dmg-legacy CREATEDMG_FLAGS=--skip-jenkins
393+
make -C src macvim-dmg-legacy
397394
else
398-
make -C src macvim-dmg CREATEDMG_FLAGS=--skip-jenkins
395+
make -C src macvim-dmg
399396
fi
400397
401398
if ${{ matrix.publish_postfix != '' }}; then
402399
mv src/MacVim/build/Release/MacVim.dmg src/MacVim/build/Release/MacVim${{ matrix.publish_postfix }}.dmg
403400
fi
404401
402+
# Upload the dmg installer only when making tagged release or making a dev build from a master branch.
403+
# Note that this doesn't create a GitHub release for us, because we would prefer to do it manually, for two
404+
# reasons: 1) signing / notarization are currently done out of CI, 2) we want to manually format our release notes
405+
# and add pictures to make them look nice.
405406
- name: Upload MacVim image
406-
if: startsWith(github.ref, 'refs/tags/') && matrix.publish
407+
if: matrix.publish && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master')
407408
uses: actions/upload-artifact@v4
408409
with:
409410
name: MacVim${{ matrix.publish_postfix }}.dmg
410411
path: src/MacVim/build/Release/MacVim${{ matrix.publish_postfix }}.dmg
412+
413+
# If doing a tagged release, use repository-specified number of retention days (usually 90 days) to make it
414+
# easier to audit. (specify "0" to indicate using repository settings)
415+
#
416+
# Otherwise, we are just doing a dev build for potential testing, just use a maximum of 21 days as we don't
417+
# tend to need these for long.
418+
retention-days: ${{ startsWith(github.ref, 'refs/tags/') && 0 || (github.retention_days > 21 && 21 || 0) }}

0 commit comments

Comments
 (0)