Files
Packer-Cn/.github/workflows/nightly-release.yml
dependabot[bot] a3f194a8d1 build(deps): bump the actions group across 1 directory with 7 updates
Bumps the actions group with 7 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `4.2.2` | `4.3.1` |
| [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) | `4.0.2` | `4.3.1` |
| [slackapi/slack-github-action](https://github.com/slackapi/slack-github-action) | `1.27.0` | `1.27.1` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `4.6.0` | `4.6.2` |
| [actions/github-script](https://github.com/actions/github-script) | `7.0.1` | `7.1.0` |
| [actions/download-artifact](https://github.com/actions/download-artifact) | `4.1.8` | `4.3.0` |
| [ncipollo/release-action](https://github.com/ncipollo/release-action) | `1.15.0` | `1.21.0` |



Updates `actions/checkout` from 4.2.2 to 4.3.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/11bd71901bbe5b1630ceea73d27597364c9af683...34e114876b0b11c390a56381ad16ebd13914f8d5)

Updates `aws-actions/configure-aws-credentials` from 4.0.2 to 4.3.1
- [Release notes](https://github.com/aws-actions/configure-aws-credentials/releases)
- [Changelog](https://github.com/aws-actions/configure-aws-credentials/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws-actions/configure-aws-credentials/compare/e3dd6a429d7300a6a4c196c26e071d42e0343502...7474bc4690e29a8392af63c5b98e7449536d5c3a)

Updates `slackapi/slack-github-action` from 1.27.0 to 1.27.1
- [Release notes](https://github.com/slackapi/slack-github-action/releases)
- [Changelog](https://github.com/slackapi/slack-github-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/slackapi/slack-github-action/compare/37ebaef184d7626c5f204ab8d3baff4262dd30f0...fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3)

Updates `actions/upload-artifact` from 4.6.0 to 4.6.2
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08...ea165f8d65b6e75b540449e92b4886f43607fa02)

Updates `actions/github-script` from 7.0.1 to 7.1.0
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/60a0d83039c74a4aee543508d2ffcb1c3799cdea...f28e40c7f34bde8b3046d885e986cb6290c5673b)

Updates `actions/download-artifact` from 4.1.8 to 4.3.0
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/fa0a91b85d4f404e444e00e005971372dc801d16...d3f86a106a0bac45b974a628896c90dbdf5c8093)

Updates `ncipollo/release-action` from 1.15.0 to 1.21.0
- [Release notes](https://github.com/ncipollo/release-action/releases)
- [Commits](https://github.com/ncipollo/release-action/compare/cdcc88a9acf3ca41c16c37bb7d21b9ad48560d87...339a81892b84b4eeb0f6e744e4574d79d0d9b8dd)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 4.3.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: aws-actions/configure-aws-credentials
  dependency-version: 4.3.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: slackapi/slack-github-action
  dependency-version: 1.27.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: actions/upload-artifact
  dependency-version: 4.6.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: actions/github-script
  dependency-version: 7.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: actions/download-artifact
  dependency-version: 4.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: ncipollo/release-action
  dependency-version: 1.21.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-06-03 06:56:15 +00:00

143 lines
5.3 KiB
YAML

#
# This GitHub action triggers a fresh set of Packer builds
# and publishes them to GitHub Releases under the `nightly` tag.
# Note that artifacts available via GitHub Releases are not codesigned or notarized.
# Failures are reported to slack.
#
name: Nightly Release
on:
schedule:
# Runs against the default branch every day at midnight
- cron: "0 0 * * *"
workflow_dispatch:
permissions:
contents: write
jobs:
# Build a fresh set of artifacts
build-artifacts:
uses: hashicorp/packer/.github/workflows/build.yml@main
github-release:
needs: build-artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Download built artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
path: out/
# Set BUILD_OUTPUT_LIST to out\<project>-<version>.<fileext>\*,out\...
# This is needed to attach the build artifacts to the GitHub Release
- name: Set BUILD_OUTPUT_LIST
run: |
echo "$(ls -xm1 out/)" > tmp.txt
cat tmp.txt | sed 's:.*:out/&/*:' > tmp2.txt
echo "BUILD_OUTPUT_LIST=$(cat tmp2.txt | tr '\n' ',' | perl -ple 'chop')" >> $GITHUB_ENV
rm -rf tmp.txt && rm -rf tmp2.txt
- name: Advance nightly tag
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
try {
await github.rest.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "tags/nightly"
})
} catch (e) {
console.log("Warning: The nightly tag doesn't exist yet, so there's nothing to do. Trace: " + e)
}
await github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/nightly",
sha: context.sha
})
# This will create a new GitHub Release called `nightly`
# If a release with this name already exists, it will overwrite the existing data
- name: Create a nightly GitHub prerelease
id: create_prerelease
continue-on-error: true
uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1.21.0
with:
name: nightly
artifacts: "${{ env.BUILD_OUTPUT_LIST }}"
tag: nightly
bodyFile: ".github/workflows/nightly-release-readme.md"
prerelease: true
allowUpdates: true
removeArtifacts: true
draft: false
token: ${{ secrets.GITHUB_TOKEN }}
- name: Store GitHub Release ID
if: steps.create_prerelease.outcome == 'success'
run: |
echo "prerelease_id=${{ steps.create_prerelease.outputs.id }}" >> $GITHUB_ENV
- name: Sleep before retry
id: sleep_before_retry
if: steps.create_prerelease.outcome == 'failure'
run : sleep 30m
shell: bash
- name: Retry failed nightly GitHub prerelease
id: create_prerelease_retry
if: steps.create_prerelease.outcome == 'failure'
uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1.21.0
with:
name: nightly
artifacts: "${{ env.BUILD_OUTPUT_LIST }}"
tag: nightly
bodyFile: ".github/workflows/nightly-release-readme.md"
prerelease: true
allowUpdates: true
removeArtifacts: true
draft: false
token: ${{ secrets.GITHUB_TOKEN }}
- name: Store Updated GitHub Release ID
if: steps.create_prerelease_retry.outcome == 'success'
run: |
echo "prerelease_id=${{ steps.create_prerelease_retry.outputs.id }}" >> $GITHUB_ENV
- name: Publish nightly GitHub prerelease
uses: eregon/publish-release@01df127f5e9a3c26935118e22e738d95b59d10ce # v1.0.6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ env.prerelease_id }}
# Send a slack notification if either job defined above fails
slack-notify:
permissions:
contents: none
needs:
- build-artifacts
- github-release
if: always() && (needs.build-artifacts.result == 'failure' || needs.github-release.result == 'failure')
runs-on: ubuntu-latest
steps:
- name: Send slack notification on failure
uses: slackapi/slack-github-action@fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3 # v1.27.1
with:
payload: |
{
"text": ":alert: Packer Nightly Release *FAILED* :alert:",
"attachments": [
{
"color": "#C41E3A",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Branch: `${{ github.ref_name }}`\nRef: ${{ github.sha }}\nWorkflow: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
}
]
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK