Skip to content

Bump gopkg.in/yaml.v3 from 3.0.0-20210107192922-496545a6307b to 3.0.0 in /ethminer-exporter #6

Bump gopkg.in/yaml.v3 from 3.0.0-20210107192922-496545a6307b to 3.0.0 in /ethminer-exporter

Bump gopkg.in/yaml.v3 from 3.0.0-20210107192922-496545a6307b to 3.0.0 in /ethminer-exporter #6

name: "Ethminer Metrics Exporter"
on:
pull_request:
branches:
- '**'
paths:
- 'ethminer-exporter/*'
- 'ethminer-exporter/**/*'
- .github/workflows/exporter-build.yml
push:
branches:
- main
paths:
- 'ethminer-exporter/*'
- 'ethminer-exporter/**/*'
- .github/workflows/exporter-build.yml
jobs:
ci:
runs-on: ubuntu-18.04
name: CI
steps:
- name: git checkout
uses: actions/checkout@v2
- name: extract versions
id: versions
run: |
version=$(cat VERSION)
echo "::set-output name=git-tag::ethminer-exporter-v${version}"
echo "::set-output name=version::v${version}"
echo "::set-output name=dirty-version::v${version}-$(git rev-parse --short HEAD)"
working-directory: ethminer-exporter
- name: docker login
uses: azure/docker-login@v1
with:
login-server: ghcr.io
username: hfuss
password: ${{ secrets.PACKAGES_TOKEN }}
- name: test
run: |
make test
fmt=$(go fmt ./.../ | wc -l)
[[ "$fmt" -eq "0" ]]
working-directory: ethminer-exporter
- name: build
run: |
docker build . -f build/Dockerfile -t ghcr.io/hfuss/ethminer-exporter:${{ steps.versions.outputs.dirty-version }}
docker run -i ghcr.io/hfuss/ethminer-exporter:${{ steps.versions.outputs.dirty-version }} client --help
docker push ghcr.io/hfuss/ethminer-exporter:${{ steps.versions.outputs.dirty-version }}
working-directory: ethminer-exporter
- name: enforce new version
run: |
git ls-remote --exit-code origin --tags '${{ steps.versions.outputs.git-tag }}' && found=true
if [[ "${found}" == "true" ]]; then
echo "${{ steps.versions.outputs.git-tag }} tag already exists, please update the version and changelog"
exit 1
fi
- name: enforce changelog
if: ${{ github.event_name == 'pull_request' }}
uses: dangoslen/changelog-enforcer@v2
with:
changeLogPath: 'ethminer-exporter/CHANGELOG.md'
skipLabels: 'Skip-Changelog'
expectedLatestVersion: ${{ steps.versions.outputs.version }}
- name: extract changelog
id: changelog
uses: mindsers/changelog-reader-action@v2
with:
validation_depth: 10
version: ${{ steps.versions.outputs.version }}
path: ethminer-exporter/CHANGELOG.md
- name: tag images
run: |
docker tag ghcr.io/hfuss/ethminer-exporter:${{ steps.versions.outputs.dirty-version }} ghcr.io/hfuss/ethminer-exporter:${{ steps.versions.outputs.version }}
docker tag ghcr.io/hfuss/ethminer-exporter:${{ steps.versions.outputs.dirty-version }} ghcr.io/hfuss/ethminer-exporter:latest
- name: promote images
if: ${{ github.event_name == 'push' }}
run: |
docker push ghcr.io/hfuss/ethminer-exporter:${{ steps.versions.outputs.version }}
docker push ghcr.io/hfuss/ethminer-exporter:latest
- name: git release
uses: actions/create-release@v1
if: ${{ github.event_name == 'push' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.versions.outputs.git-tag }}
release_name: Ethminer Metrics Exporter ${{ steps.versions.outputs.version }} Release
body: ${{ steps.changelog.outputs.changes }}
draft: false
prerelease: false