Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CodeQL

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "27 3 * * 1"

jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
security-events: write
packages: read
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: go
build-mode: autobuild
- language: actions
build-mode: none

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Go
if: matrix.language == 'go'
uses: actions/setup-go@v5
with:
go-version: "1.22"
cache: true

- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}

- name: Autobuild
if: matrix.build-mode == 'autobuild'
uses: github/codeql-action/autobuild@v4

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
Comment thread
egenthon-cmd marked this conversation as resolved.
with:
category: "/language:${{matrix.language}}"
33 changes: 12 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,27 @@
name: PyInstaller
name: Build

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python 3.8
uses: actions/setup-python@v2
- name: Set up Go
uses: actions/setup-go@v5
with:
python-version: 3.8

- name: Install dependencies
run: |
pip install --upgrade pip
pip install pyinstaller click requests prettytable
go-version: "1.22"

- name: Build executable
run: |
pyinstaller --onefile gladia_cli.py --hidden-import=click --hidden-import=requests --hidden-import=prettytable

- name: Upload release
uses: ncipollo/release-action@v1
with:
artifacts: "./dist/gladia_cli"
bodyFile: "release_note.md"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: make build

- name: Test
run: make test
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release

on:
push:
tags:
- "v*"

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
Comment thread
egenthon-cmd marked this conversation as resolved.
persist-credentials: false

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
Comment thread
egenthon-cmd marked this conversation as resolved.

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 2 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
#
# PYTHON
#

# Ignore build files
build/
*.egg-info/

# Ignore Python cache and compiled files
__pycache__/
*.pyc
*.pyo
*.pyd
*.pyz

# Ignore virtual environments
venv/

#
# GOLANG
#
Expand Down Expand Up @@ -52,4 +34,5 @@ cover.out
cover.html
.vscode

.idea/
.idea/
gladia
67 changes: 67 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
version: 2

project_name: gladia

before:
hooks:
- go mod tidy

builds:
- main: ./cmd/
binary: gladia
ldflags:
- -s -w -X main.version={{.Version}}
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
- "386"
- arm
goarm:
- "7"
ignore:
- goos: windows
goarch: arm64
- goos: windows
goarch: arm
- goos: darwin
goarch: "386"
- goos: darwin
goarch: arm

archives:
- formats:
- tar.gz
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
format_overrides:
- goos: windows
formats:
- zip

checksum:
name_template: "checksums.txt"

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- "^chore:"
- Merge pull request
- Merge branch

release:
github:
owner: gladiaio
name: gladia-cli
draft: false
prerelease: auto
extra_files:
- glob: install.sh
- glob: install.ps1
21 changes: 11 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@

build:
go build -o gladia -v ./cmd/*.go
go build -o gladia -v ./cmd/

.PHONY: dist
dist:
GOOS=linux GOARCH=arm GOARM=7 go build -o dist/gladia-linux-arm7 -v ./cmd/*.go
GOOS=linux GOARCH=arm64 go build -o dist/gladia-linux-arm64 -v ./cmd/*.go
GOOS=linux GOARCH=amd64 go build -o dist/gladia-linux-x86_64 -v ./cmd/*.go
GOOS=linux GOARCH=386 go build -o dist/gladia-linux-i386 -v ./cmd/*.go
GOOS=windows GOARCH=amd64 go build -o dist/gladia-windows-x86_64.exe -v ./cmd/*.go
GOOS=darwin GOARCH=amd64 go build -o dist/gladia-darwin-x86_64 -v ./cmd/*.go
GOOS=darwin GOARCH=arm64 go build -o dist/gladia-darwin-arm64 -v ./cmd/*.go
mkdir -p dist
GOOS=linux GOARCH=arm GOARM=7 go build -o dist/gladia-linux-arm7 -v ./cmd/
GOOS=linux GOARCH=arm64 go build -o dist/gladia-linux-arm64 -v ./cmd/
GOOS=linux GOARCH=amd64 go build -o dist/gladia-linux-amd64 -v ./cmd/
GOOS=linux GOARCH=386 go build -o dist/gladia-linux-i386 -v ./cmd/
GOOS=windows GOARCH=amd64 go build -o dist/gladia-windows-amd64.exe -v ./cmd/
GOOS=darwin GOARCH=amd64 go build -o dist/gladia-darwin-amd64 -v ./cmd/
GOOS=darwin GOARCH=arm64 go build -o dist/gladia-darwin-arm64 -v ./cmd/

@echo "Dist files:"
@ls -l dist

dev:
go run -x ./cmd/*.go -audio-file split_infinity.wav
go run ./cmd/ transcribe split_infinity.wav
watch-dev:
go run -x ./cmd/*.go -audio-file split_infinity.wav
go run ./cmd/ transcribe split_infinity.wav

test:
go test -race -v ./...
Expand Down
Loading
Loading