Skip to content

Commit

Permalink
feat: fixed typo
Browse files Browse the repository at this point in the history
fix: release pipeline (#32)
  • Loading branch information
drgsn committed Dec 26, 2024
1 parent af929f8 commit 6a37c31
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 79 deletions.
62 changes: 34 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,43 @@
name: Release

on:
push:
# Trigger this workflow only when you push a tag that starts with "v",
# e.g. "v1.0.0" or "v2.0.0".
tags:
- 'v*.*.*'
push:
tags:
- 'v*'

# Add permissions needed for creating releases
permissions:
contents: write
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
# We fetch all commits & tags so GoReleaser can properly read the tag version
fetch-depth: 0
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'

- name: Run GoReleaser
# The official GoReleaser GitHub Action
uses: goreleaser/goreleaser-action@v4
with:
# By default, it will look for .goreleaser.yml in the repo root
version: latest
args: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install cross-compilation tools
run: |
sudo apt-get update
sudo apt-get install -y \
gcc g++ make \
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
gcc-mingw-w64 g++-mingw-w64 \
mingw-w64
echo "Installing tools completed"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CGO_ENABLED: 1
78 changes: 29 additions & 49 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,30 @@
version: 2

before:
hooks:
# If you have tests, uncomment:
- go test ./...
- echo "Starting GoReleaser..."

builds:
- id: filefusion
# If your main.go is in the root folder, use "." or "./".
main: ./cmd/filefusion/main.go
# The base output filename (GoReleaser adds .exe for Windows).
binary: filefusion
# Target OS/Arch combos:
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
# Disable CGO if not needed:
env:
- CGO_ENABLED=0

archives:
- id: filefusion-archive
# Name format for each archive
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
# Linux & macOS get tar.gz by default; Windows gets .zip
format_overrides:
- goos: windows
format: zip
# Files to include in the archive
files:
- README*
- LICENSE*
allow_different_binary_count: true

# Publishes a GitHub release for the git tag you push (e.g., v0.0.2).
release:
prerelease: auto
draft: false
name_template: "v{{ .Version }}"

# Generate checksums for the archives
checksum:
name_template: "checksums.txt"
algorithm: sha256
- id: filefusion
main: ./cmd/filefusion/main.go
binary: filefusion
goos:
- linux
- windows
goarch:
- amd64
- arm64
env:
- CGO_ENABLED=1
flags:
- -tags=bash cpp csharp golang css html java php kotlin javascript ruby python swift typescript sql
overrides:
- goos: linux
goarch: arm64
env:
- CGO_ENABLED=1
- CC=aarch64-linux-gnu-gcc
- CXX=aarch64-linux-gnu-g++
- goos: windows
goarch: amd64
env:
- CGO_ENABLED=1
- CC=x86_64-w64-mingw32-gcc
- CXX=x86_64-w64-mingw32-g++
ignore:
- goos: windows
goarch: arm64
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ documents:
- Be specific with patterns
- Test patterns before processing

## ❗ Common Issues and Solutions
## ❗ Issues and Solutions

### "no files found matching pattern"

Expand All @@ -387,5 +387,5 @@ documents:
---

<div align="center">
Made with ❤️ by the DrGos team
Made with ❤️ by the DrGos
</div>

0 comments on commit 6a37c31

Please sign in to comment.