1.7.20: add APK and Python packages #96
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
name: release | |
on: | |
push: | |
tags: | |
- "*" | |
permissions: | |
contents: write | |
jobs: | |
goreleaser: | |
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: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- run: python -m pip install --upgrade pip twine wheel setuptools | |
- 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' | |
args: release --clean --verbose | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} | |
- name: Publish to NPM, Rubygems and PyPI | |
env: | |
NPM_API_KEY: ${{ secrets.NPM_API_KEY }} | |
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} | |
PYPI_API_KEY: ${{ secrets.PYPI_API_KEY }} | |
run: | | |
cat << EOF > ~/.npmrc | |
//registry.npmjs.org/:_authToken=${NPM_API_KEY} | |
EOF | |
chmod 0600 ~/.npmrc | |
mkdir -p ~/.gem/ | |
cat << EOF > ~/.gem/credentials | |
--- | |
:rubygems_api_key: ${RUBYGEMS_API_KEY} | |
EOF | |
chmod 0600 ~/.gem/credentials | |
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 | |
- name: Update Homebrew formula | |
uses: dawidd6/action-homebrew-bump-formula@v3 | |
with: | |
formula: lefthook | |
token: ${{secrets.HOMEBREW_TOKEN}} | |
- name: Publish to Winget | |
uses: vedantmgoyal2009/winget-releaser@v2 | |
with: | |
identifier: evilmartians.lefthook | |
fork-user: mrexox | |
token: ${{ secrets.WINGET_TOKEN }} |