Rimgo build #6
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
name: Rimgo build | |
on: [workflow_dispatch] | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3.3.0 | |
- run: sudo apt-get install -y ca-certificates git nodejs npm tar zip | |
- uses: actions/setup-go@v4 | |
- run: | | |
mkdir rimgo | |
cd rimgo/ | |
git clone --depth 1 https://codeberg.org/rimgo/rimgo | |
cd rimgo/ | |
npx tailwindcss -i static/tailwind.css -o static/app.css -m | |
go mod download | |
GOARCH=amd64 GOOS=linux go build -ldflags "-X codeberg.org/rimgo/rimgo/pages.VersionInfo=$(date '+%Y-%m-%d')-$(git rev-list --abbrev-commit -1 HEAD)" | |
mv rimgo ../rimgo_linux_x86_64 | |
GOARCH=amd64 GOOS=windows go build -ldflags "-X codeberg.org/rimgo/rimgo/pages.VersionInfo=$(date '+%Y-%m-%d')-$(git rev-list --abbrev-commit -1 HEAD)" | |
mv rimgo.exe ../rimgo_windows_x86_64.exe | |
mv views/ ../ | |
mv static/ ../ | |
cd ../../ | |
tar -czvf rimgo_linux_x86_64.tar.gz rimgo/rimgo_linux_x86_64 rimgo/views rimgo/static | |
zip rimgo_windows_x86_64.zip rimgo/rimgo_windows_x86_64.exe rimgo/views/* rimgo/static/* | |
mv rimgo_linux_x86_64.tar.gz binaries/ | |
mv rimgo_windows_x86_64.zip binaries/ | |
rm -fr rimgo/ | |
- run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add -A | |
git commit -m "Update Rimgo binaries" | |
- uses: ad-m/github-push-action@v0.6.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: main |