Skip to content

Commit

Permalink
feat: Add arm64 unit test, and Creating arm64 binaries #262 (#263)
Browse files Browse the repository at this point in the history
* add: arm64 build test

* fix: cc

* fix: sudo

* del: darwin, windows

* fix: upload artifact

* fix: disable cgo

* fix: upgrade go

* fix: add arch

* fix: bump patch

* fix: change lint to go vet
  • Loading branch information
jiro4989 authored Feb 26, 2024
1 parent 17b29d8 commit 145e591
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: release

env:
app: textimg
goversion: '1.18'
goversion: '1.21'
build_opts: '-ldflags="-s -w -extldflags \"-static\""'

jobs:
Expand All @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
os: [linux, windows, darwin]
arch: [amd64]
arch: [amd64, arm64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:
strategy:
matrix:
os: [linux, windows, darwin]
arch: [amd64]
arch: [amd64, arm64]
include:
- os: windows
asset_content_type: application/zip
Expand Down
35 changes: 30 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ name: test
- LICENSE

env:
goversion: '1.18'
goversion: '1.21'

jobs:
test:
Expand All @@ -35,6 +35,33 @@ jobs:
- run: go install
- run: go test -cover ./...

build-arm64:
runs-on: ubuntu-latest
strategy:
matrix:
go:
- '1.x'
os:
- 'linux'
- 'darwin'
- 'windows'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
# if use CGO_ENABLED=1 then use this code.
#
# - run: sudo apt-get install -y gcc-aarch64-linux-gnu
# - run: GOOS=${{ matrix.os }} GOARCH=arm64 CGO_ENABLED=1 CC=aarch64-linux-gnu-gcc go build -o textimg_${{ matrix.os }}_arm64
- run: GOOS=${{ matrix.os }} GOARCH=arm64 go build -o textimg_${{ matrix.os }}_arm64
- run: gzip textimg_${{ matrix.os }}_arm64
- name: Upload artifact (windows)
uses: actions/upload-artifact@v4
with:
name: textimg_${{ matrix.os }}_arm64.gz
path: textimg_${{ matrix.os }}_arm64.gz

format:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -67,10 +94,8 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version: ${{ env.goversion }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.45
- name: Lint
run: go vet .

coverage:
runs-on: ubuntu-latest
Expand Down
6 changes: 0 additions & 6 deletions .golangci.yml

This file was deleted.

2 changes: 1 addition & 1 deletion internal/global/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package global

const (
AppName = "textimg"
Version = `3.1.9
Version = `3.1.10
Copyright (c) 2019 jiro4989
Released under the MIT License.
https://github.com/jiro4989/textimg`
Expand Down

0 comments on commit 145e591

Please sign in to comment.