-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: Add goreleaser Github Action Signed-off-by: Valentin Kiselev <mrexox@evilmartians.com> * feature: Add snapcraft install Signed-off-by: Valentin Kiselev <mrexox@evilmartians.com> * feature: Push to Rubygems from CI Signed-off-by: Valentin Kiselev <mrexox@evilmartians.com> * feature: Publish to NPM Signed-off-by: Valentin Kiselev <mrexox@evilmartians.com> Signed-off-by: Valentin Kiselev <mrexox@evilmartians.com>
- Loading branch information
Showing
1 changed file
with
74 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: goreleaser | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Fetch all tags | ||
run: git fetch --force --tags | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: Install Snapcraft | ||
uses: samuelmeuli/action-snapcraft@v1 | ||
with: | ||
snapcraft_token: ${{ secrets.SNAPCRAFT_TOKEN }} | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Update Homebrew formula | ||
uses: dawidd6/action-homebrew-bump-formula@v3 | ||
with: | ||
formula: lefthook | ||
token: ${{secrets.HOMEBREW_TOKEN}} | ||
|
||
- name: Publish to Rubygems | ||
env: | ||
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} | ||
run: | | ||
mkdir ~/.gem/ | ||
cat << EOF > ~/.gem/credentials | ||
--- | ||
:rubygems_api_key: ${RUBYGEMS_API_KEY} | ||
EOF | ||
git clean -fdX packaging/rubygems/libexec/ | ||
cd dist | ||
find . -maxdepth 2 -executable -type f -exec cp --parents \{\} ../packaging/rubygems/libexec/ \; | ||
cd ../packaging/rubygems | ||
rake build | ||
gem push pkg/*.gem | ||
cd ../.. | ||
- name: Publish to NPM | ||
env: | ||
NPM_API_KEY: ${{ secrets.NPM_API_KEY }} | ||
run: | | ||
cat << EOF > ~/.npmrc | ||
//registry.npmjs.org/:_authToken=${NPM_API_KEY} | ||
EOF | ||
cd packaging/npm/ | ||
make prepare | ||
make publish |