Add gha osv scanner; #45
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Make release | |
on: | |
workflow_dispatch: | |
inputs: | |
make_release_draft: | |
description: Create release draft | |
default: true | |
type: boolean | |
required: true | |
build_dockerimage: | |
description: Build docker images and push to docker hub | |
default: true | |
type: boolean | |
required: true | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build_release: | |
name: Build release | |
runs-on: ubuntu-22.04 | |
env: | |
GOPATH: /home/runner/go | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Make crossbuild | |
run: make crossbuild | |
- name: Make tarballs | |
run: make tarballs | |
- name: Upload files to release and create draft | |
# if: ${{ inputs.make_release_draft }} | |
run: make release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache artifacts | |
uses: actions/cache@v3 | |
with: | |
path: .build | |
key: syncthing_exporter-${{ github.sha }} | |
build_dockerimage: | |
# if: ${{ inputs.build_dockerimage }} | |
needs: build_release | |
name: Build docker images | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set VERSION as environment variable | |
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV | |
- name: Cache artifacts | |
uses: actions/cache@v3 | |
with: | |
path: .build | |
key: syncthing_exporter-${{ github.sha }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v6,linux/arm/v7 | |
push: true | |
target: ghactions | |
tags: | | |
f100024/syncthing_exporter:latest, | |
f100024/syncthing_exporter:${{ env.VERSION }} | |
env: | |
DOCKER_BUILDKIT: 1 |