Update dependencies #282
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
# Copyright 2021 Jeremy Edwards | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
name: CI | |
on: | |
push: | |
tags: ["v*"] | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
# Set the job key. The key is displayed as the job name | |
# when a job name is not provided | |
push-image: | |
name: Push Images | |
# Set the type of machine to run on | |
runs-on: ubuntu-latest | |
steps: | |
# Checks out a copy of your repository on the ubuntu-latest machine | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# https://github.com/actions/setup-go | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.22' | |
- name: Install Prerequisites | |
run: | | |
sudo apt-get update | |
sudo apt -y -q install software-properties-common | |
sudo add-apt-repository universe | |
sudo apt-get update | |
sudo apt-get -y -q install lz4 p7zip-full rar unrar | |
- name: Prepare Build | |
run: | | |
make clean | |
make deps | |
make lint | |
- name: Test | |
run: | | |
make test-10 | |
make benchmark | |
make coverage.txt | |
- name: Push Code Coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos | |
files: ./coverage.txt # optional | |
flags: unittests # optional | |
name: codecov-umbrella # optional | |
fail_ci_if_error: true # optional (default = false) | |
verbose: true # optional (default = false) | |
- name: Build | |
run: | | |
make all -j$(nproc) | |
make bin/release.tar.gz | |
make release-binaries | |
# https://github.com/docker/login-action#github-packages-docker-registry | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# https://github.com/docker/login-action#github-packages-docker-registry | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Push Images (Commit) | |
if: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
run: | | |
make REGISTRY=docker.io/jeremyje images | |
make bin/release.tar.gz | |
- name: Push Images (Release) | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
make DOCKER_PUSH=--push REGISTRY=docker.io/jeremyje images | |
make DOCKER_PUSH=--push REGISTRY=ghcr.io/jeremyje images | |
make bin/release.tar.gz | |
- name: Push Images (Latest) | |
if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-') | |
run: | | |
make DOCKER_PUSH=--push REGISTRY=docker.io/jeremyje images | |
make DOCKER_PUSH=--push REGISTRY=ghcr.io/jeremyje images | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
generate_release_notes: true | |
draft: false | |
prerelease: false | |
files: | | |
LICENSE | |
bin/release.tar.gz | |
bin/release/certtool-386 | |
bin/release/certtool-386.exe | |
bin/release/certtool-amd64 | |
bin/release/certtool-amd64-darwin | |
bin/release/certtool-amd64.exe | |
bin/release/certtool-arm | |
bin/release/certtool-arm64 | |
bin/release/certtool-arm64-darwin | |
bin/release/certtool-arm64.exe | |
bin/release/httpprobe-386 | |
bin/release/httpprobe-386.exe | |
bin/release/httpprobe-amd64 | |
bin/release/httpprobe-amd64-darwin | |
bin/release/httpprobe-amd64.exe | |
bin/release/httpprobe-arm | |
bin/release/httpprobe-arm64 | |
bin/release/httpprobe-arm64-darwin | |
bin/release/httpprobe-arm64.exe | |
bin/release/server-386 | |
bin/release/server-386.exe | |
bin/release/server-amd64 | |
bin/release/server-amd64-darwin | |
bin/release/server-amd64.exe | |
bin/release/server-arm | |
bin/release/server-arm64 | |
bin/release/server-arm64-darwin | |
bin/release/server-arm64.exe | |
- name: Publish Application | |
uses: actions/upload-artifact@v3 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: release.tar.gz | |
path: | | |
bin/release.tar.gz | |
bin/release/* |