Skip to content

Merge pull request #227 from anchore/temp-unblock-release-2 #52

Merge pull request #227 from anchore/temp-unblock-release-2

Merge pull request #227 from anchore/temp-unblock-release-2 #52

Workflow file for this run

name: 'Release'
on:
push:
# take no actions on push to any branch...
branches-ignore:
- '**'
# ... only act on release tags
tags:
- 'v*'
env:
GO_VERSION: "1.22.x"
jobs:
wait-for-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 #v4.1.6
# we don't want to release commits that have been pushed and tagged, but not necessarily merged onto main
- name: Ensure tagged commit is on main
run: |
echo "Tag: ${GITHUB_REF##*/}"
git fetch origin main
git merge-base --is-ancestor ${GITHUB_REF##*/} origin/main && echo "${GITHUB_REF##*/} is a commit on main!"
release:
needs: [ wait-for-checks ]
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 #v5.0.1
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 #v4.1.6
with:
fetch-depth: 0
- name: Restore bootstrap cache
id: cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 #v4.0.2
with:
path: |
~/go/pkg/mod
${{ github.workspace }}/.tmp
key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ hashFiles('Makefile') }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ hashFiles('Makefile') }}-
${{ runner.os }}-go-${{ env.GO_VERSION }}-
- name: Bootstrap dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: make ci-bootstrap
- name: Login to Docker Hub
id: docker-login
run: |
echo "${DOCKER_PASS}" | docker login -u "${DOCKER_USER}" --password-stdin
env:
DOCKER_USER: ${{ secrets.ANCHOREINTEGRATIONSWRITE_DH_USERNAME }}
DOCKER_PASS: ${{ secrets.ANCHOREINTEGRATIONSWRITE_DH_PAT }}
- name: Build snapshot artifacts
run: make release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 #v4.3.3
with:
name: artifacts
path: dist/**/*