Add RPM/APT publish #8
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: Release | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
permissions: | ||
contents: write | ||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- run: git fetch --force --tags | ||
- name: Get Go version from .tool-versions | ||
run: echo "GO_VERSION=$(cat .tool-versions | grep -oP 'golang \K((\w+.)+\w+)')" >> $GITHUB_ENV | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '${{ env.GO_VERSION }}' | ||
- name: Get nfpm version from .tool-versions | ||
run: echo "NFPM_VERSION=$(cat .tool-versions | grep -oP 'nfpm \K((\w+.)+\w+)')" >> $GITHUB_ENV | ||
- name: Setup nfpm | ||
uses: supplypike/setup-bin@v3 | ||
with: | ||
uri: 'https://github.com/goreleaser/nfpm/releases/download/v${{ env.NFPM_VERSION }}/nfpm_${{ env.NFPM_VERSION }}_Linux_x86_64.tar.gz' | ||
name: 'nfpm' | ||
version: ${{ env.NFPM_VERSION }}' | ||
- name: Setup fury | ||
uses: supplypike/setup-bin@v3 | ||
with: | ||
uri: 'https://github.com/gemfury/cli/releases/download/v0.20.1/fury_0.20.1_Linux_64bit.tar.gz' | ||
name: 'fury' | ||
version: '0.20.1' | ||
- name: Get goreleaser version from .tool-versions | ||
run: echo "GORELEASER_VERSION=$(cat .tool-versions | grep -oP 'goreleaser \K((\w+.)+\w+)')" >> $GITHUB_ENV | ||
- uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
distribution: goreleaser | ||
version: '${{ env.GORELEASER_VERSION }}' | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | ||
PROJECT: github.com/inverse/git-pair | ||
AUR_KEY: ${{ secrets.AUR_KEY }} | ||
- name: Upload rpm and apt binaries | ||
run: ./scripts/deploy.sh | ||
env: | ||
FURY_TOKEN: ${{ secrets.FURY_TOKEN }} |