forked from rupor-github/fb2converter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Eugen
authored
Apr 14, 2022
1 parent
3668833
commit 065bf65
Showing
1 changed file
with
55 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,55 @@ | ||
name: Build&release | ||
on: push | ||
jobs: | ||
build: | ||
runs-on: ${{ matrix.dist }} | ||
name: ${{ matrix.goos }} ${{ matrix.goarch }} build | ||
strategy: | ||
matrix: | ||
include: | ||
- dist: ubuntu-latest | ||
goos: linux | ||
goarch: arm64 | ||
- dist: ubuntu-latest | ||
goos: linux | ||
goarch: amd64 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set version | ||
env: | ||
GOOS: ${{ matrix.goos }} | ||
GOARCH: ${{ matrix.goarch }} | ||
run: | | ||
mkdir -p misc && cp cmake/version.go.in misc/version.go | ||
sed -i "s/@PRJ_VERSION_MAJOR@.@PRJ_VERSION_MINOR@.@PRJ_VERSION_PATCH@/${GITHUB_REF##*/}-${GOOS}-${GOARCH}/g" misc/version.go | ||
sed -i "s/@GIT_HASH@/${GITHUB_SHA}/g" misc/version.go | ||
cat misc/version.go | ||
- name: Download dictionaries | ||
run: | | ||
cd static/dictionaries | ||
wget -r -l1 --no-parent -nd -A.pat.txt http://ctan.math.utah.edu/ctan/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/txt | ||
wget -r -l1 --no-parent -nd -A.hyp.txt http://ctan.math.utah.edu/ctan/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/txt | ||
for a in $(ls *.txt); do gzip $a; done | ||
- name: Download sentences | ||
run: | | ||
cd static/sentences | ||
curl -L https://api.github.com/repos/neurosnap/sentences/tarball | tar xz --wildcards '*/data/*.json' --strip-components=2 | ||
for a in $(ls *.json); do gzip $a; done | ||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
- name: Build | ||
env: | ||
GOOS: ${{ matrix.goos }} | ||
GOARCH: ${{ matrix.goarch }} | ||
run: | | ||
CGO_ENABLED=0 go build -mod=vendor -o fb2c fb2c.go | ||
chmod +x fb2c | ||
zip fb2c-${GOOS}-${GOARCH}-${GITHUB_REF##*/}.zip fb2c | ||
ls -lah fb2c-${GOOS}-${GOARCH}-${GITHUB_REF##*/}.zip | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: fb2c-*.zip |