mirror of
https://github.com/anchore/syft.git
synced 2026-02-12 10:36:45 +01:00
Restore version file update on release (#2844)
* restore version file update on release Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * allow for shallower fetch depth Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> --------- Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
parent
5ca26ed3ca
commit
49e93646eb
7
.github/scripts/update-version-file.sh
vendored
7
.github/scripts/update-version-file.sh
vendored
@ -2,8 +2,8 @@
|
|||||||
set -ue
|
set -ue
|
||||||
|
|
||||||
BIN="syft"
|
BIN="syft"
|
||||||
DISTDIR=$1
|
VERSION_FILE="VERSION"
|
||||||
VERSION=$2
|
VERSION=$1
|
||||||
|
|
||||||
# the source of truth as to whether we want to notify users of an update is if the release just created is NOT
|
# the source of truth as to whether we want to notify users of an update is if the release just created is NOT
|
||||||
# flagged as a pre-release on github
|
# flagged as a pre-release on github
|
||||||
@ -12,10 +12,9 @@ if [[ "$(curl -SsL https://api.github.com/repos/anchore/${BIN}/releases/tags/${V
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "creating and publishing version file"
|
echo "creating and publishing version file (${VERSION})"
|
||||||
|
|
||||||
# create a version file for version-update checks
|
# create a version file for version-update checks
|
||||||
VERSION_FILE="${DISTDIR}/VERSION"
|
|
||||||
echo "${VERSION}" | tee "${VERSION_FILE}"
|
echo "${VERSION}" | tee "${VERSION_FILE}"
|
||||||
|
|
||||||
# upload the version file that supports the application version update check
|
# upload the version file that supports the application version update check
|
||||||
|
|||||||
31
.github/workflows/release-version-file.yaml
vendored
Normal file
31
.github/workflows/release-version-file.yaml
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
name: "Release"
|
||||||
|
|
||||||
|
on:
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
description: release version to update the version file with (prefixed with v)
|
||||||
|
required: true
|
||||||
|
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
type: string
|
||||||
|
description: release version to update the version file with (prefixed with v)
|
||||||
|
required: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b #v4.1.4
|
||||||
|
|
||||||
|
- name: Update version file
|
||||||
|
run: make ci-release-version-file
|
||||||
|
env:
|
||||||
|
RELEASE_VERSION: ${{ github.event.inputs.version }}
|
||||||
|
# for updating the VERSION file in S3...
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ secrets.TOOLBOX_AWS_ACCESS_KEY_ID }}
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.TOOLBOX_AWS_SECRET_ACCESS_KEY }}
|
||||||
10
.github/workflows/release.yaml
vendored
10
.github/workflows/release.yaml
vendored
@ -139,9 +139,6 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
# for updating brew formula in anchore/homebrew-syft
|
# for updating brew formula in anchore/homebrew-syft
|
||||||
GITHUB_BREW_TOKEN: ${{ secrets.ANCHOREOPS_GITHUB_OSS_WRITE_TOKEN }}
|
GITHUB_BREW_TOKEN: ${{ secrets.ANCHOREOPS_GITHUB_OSS_WRITE_TOKEN }}
|
||||||
# for updating the VERSION file in S3...
|
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.TOOLBOX_AWS_ACCESS_KEY_ID }}
|
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.TOOLBOX_AWS_SECRET_ACCESS_KEY }}
|
|
||||||
|
|
||||||
- uses: anchore/sbom-action@7ccf588e3cf3cc2611714c2eeae48550fbc17552 #v0.15.11
|
- uses: anchore/sbom-action@7ccf588e3cf3cc2611714c2eeae48550fbc17552 #v0.15.11
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
@ -157,3 +154,10 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_TOOLBOX_WEBHOOK_URL }}
|
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_TOOLBOX_WEBHOOK_URL }}
|
||||||
if: ${{ success() }}
|
if: ${{ success() }}
|
||||||
|
|
||||||
|
release-version-file:
|
||||||
|
needs: [release]
|
||||||
|
uses: ./.github/workflows/release-version-file.yaml
|
||||||
|
with:
|
||||||
|
version: ${{ github.event.inputs.version }}
|
||||||
|
secrets: inherit
|
||||||
|
|||||||
@ -470,6 +470,16 @@ tasks:
|
|||||||
silent: true
|
silent: true
|
||||||
- "{{ .RELEASE_CMD }}"
|
- "{{ .RELEASE_CMD }}"
|
||||||
|
|
||||||
|
ci-release-version-file:
|
||||||
|
# desc: "[CI only] Update the version file"
|
||||||
|
deps: [tools]
|
||||||
|
cmds:
|
||||||
|
- task: ci-check
|
||||||
|
- ".github/scripts/update-version-file.sh {{ .RELEASE_VERSION }}"
|
||||||
|
requires:
|
||||||
|
vars:
|
||||||
|
- RELEASE_VERSION
|
||||||
|
|
||||||
|
|
||||||
## Cleanup targets #################################
|
## Cleanup targets #################################
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user