Skip to content

1.8.4: use absolute git paths internally and update dependencies #103

1.8.4: use absolute git paths internally and update dependencies

1.8.4: use absolute git paths internally and update dependencies #103

Workflow file for this run

name: release
on:
push:
tags:
- "*"
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch all tags
run: git fetch --force --tags
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v2
- name: Prevent from snapcraft fail
run: |
mkdir -p $HOME/.cache/snapcraft/download
mkdir -p $HOME/.cache/snapcraft/stage-packages
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: 'v2.4.6'
args: release --clean --verbose
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
- name: Preserve artifacts permissions with tar
run: tar -cvf dist.tar dist/
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist.tar
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/download-artifact@v4
with:
name: dist
- run: tar -xvf dist.tar
- name: Publish to NPM
env:
NPM_API_KEY: ${{ secrets.NPM_API_KEY }}
run: |
cat << EOF > ~/.npmrc
//registry.npmjs.org/:_authToken=${NPM_API_KEY}
EOF
chmod 0600 ~/.npmrc
cd packaging/
ruby pack.rb prepare
ruby pack.rb publish_npm
publish-gem:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/download-artifact@v4
with:
name: dist
- run: tar -xvf dist.tar
- name: Publish to Rubygems
env:
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
run: |
mkdir -p ~/.gem/
cat << EOF > ~/.gem/credentials
---
:rubygems_api_key: ${RUBYGEMS_API_KEY}
EOF
chmod 0600 ~/.gem/credentials
cd packaging/
ruby pack.rb prepare
ruby pack.rb publish_gem
publish-pypi:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/download-artifact@v4
with:
name: dist
- run: tar -xvf dist.tar
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: python -m pip install --upgrade pip twine wheel setuptools
- name: Publish to PyPI
env:
PYPI_API_KEY: ${{ secrets.PYPI_API_KEY }}
run: |
cat << EOF > ~/.pypirc
[distutils]
index-servers =
lefthook
[lefthook]
repository = https://upload.pypi.org/legacy/
username = __token__
password = ${PYPI_API_KEY}
EOF
chmod 0600 ~/.pypirc
cd packaging/
ruby pack.rb prepare
ruby pack.rb publish_pypi
publish-homebrew:
needs: build
runs-on: ubuntu-latest
steps:
- name: Update Homebrew formula
uses: dawidd6/action-homebrew-bump-formula@v3
with:
formula: lefthook
token: ${{secrets.HOMEBREW_TOKEN}}
publish-winget:
needs: build
runs-on: ubuntu-latest
steps:
- name: Publish to Winget
uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: evilmartians.lefthook
fork-user: mrexox
token: ${{ secrets.WINGET_TOKEN }}