Skip to content

ci: use current version of semantic-release and update config #1026

ci: use current version of semantic-release and update config

ci: use current version of semantic-release and update config #1026

Workflow file for this run

---
# yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json
name: binaries
"on":
workflow_dispatch:
pull_request:
branches:
- master
push:
branches:
- master
tags:
- v*
permissions:
contents: write
jobs:
binaries:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: token
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2
with:
app-id: ${{ secrets.TOKEN_EXCHANGE_APP }}
private-key: ${{ secrets.TOKEN_EXCHANGE_KEY }}
permission-contents: write
permission-packages: write
- name: Checkout source
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- name: Setup golang
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
with:
go-version-file: go.mod
- name: Setup task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup goreleaser
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6
with:
install-only: true
- name: Setup signing
if: github.event_name != 'pull_request'
uses: crazy-max/ghaction-import-gpg@e89d40939c28e39f97cf32126055eeae86ba74ec # v6
with:
gpg_private_key: ${{ secrets.GNUPG_KEY }}
passphrase: ${{ secrets.GNUPG_PASSWORD }}
- name: Run release
env:
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
task build:release
else
task build:snapshot
fi
- name: Install cloudsmith
if: startsWith(github.ref, 'refs/tags/')
uses: cloudsmith-io/cloudsmith-cli-action@76c8ff51a34bea1036d9b7708f10a929624a1910 # v2.0.1
with:
api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
- name: Upload packages
if: startsWith(github.ref, 'refs/tags/')
run: |
for PACKAGE in dist/github-exporter-*.deb; do
cloudsmith push deb webhippie/promhippie/any-distro/any-version "${PACKAGE}"
done
for PACKAGE in dist/github-exporter-*.rpm; do
cloudsmith push rpm webhippie/promhippie/any-distro/any-version "${PACKAGE}"
done
...