fix release job #4
Workflow file for this run
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: release | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: 1.16 | |
- name: install nekr0z/changelog | |
run: | | |
go install evgenykuznetsov.org/go/changelog/cmd/changelog@latest | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 2.7 | |
bundler-cache: true | |
- name: install dotenv | |
run: gem install dotenv -v 2.8.1 | |
- name: install fpm | |
run: gem install fpm | |
- name: build packages | |
run: | | |
git fetch --tags --force | |
mkdir release | |
changelog -n "Evgeny Kuznetsov" -e "[email protected]" -p "webmention.io-backup" CHANGELOG.md | |
bash <(VER=$(go generate); for ARCH in amd64 386 arm arm64; do GOARCH=$ARCH CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -buildid= -X main.version=$VER"; tar -czf release/webmention.io-backup-$VER-linux-$ARCH.tar.gz webmention.io-backup LICENSE README.md CHANGELOG.md SOURCE.txt; fpm -t deb -s dir -a $ARCH -n webmention.io-backup -v ${VER%+*} -m "Evgeny Kuznetsov <[email protected]>" --deb-changelog debian.changelog --license GPL-3 --deb-priority optional --url https://evgenykuznetsov.org/go/webmention.io-backup --category net --vendor "Evgeny Kuznetsov <[email protected]>" --description "A tool to backup webmentions stored on webmention.io." LICENSE=/usr/share/doc/webmention.io-backup/ README.md=/usr/share/doc/webmention.io-backup/ SOURCE.txt=/usr/share/doc/webmention.io-backup webmention.io-backup=/usr/bin/ >/dev/null; mv *.deb release/; done) | |
bash <(VER=$(go generate); for ARCH in amd64 386; do GOOS=windows GOARCH=$ARCH CGO_ENABLED=0 go build -ldflags "-s -w -buildid= -X main.version=$VER"; zip -q release/webmention.io-backup-$VER-windows-$ARCH.zip webmention.io-backup.exe LICENSE README.md CHANGELOG.md; done) | |
cd release | |
fpm -s deb -t deb -a i386 *386.deb | |
rm *_386.deb | |
fpm -s deb -t deb -a armel *arm.deb | |
rm *arm.deb | |
- name: release | |
uses: marvinpinto/[email protected] | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: false | |
files: "release/*" | |
- name: trigger repository update | |
uses: appleboy/[email protected] | |
with: | |
host: evgkuz.org | |
username: evgeny | |
key: ${{ secrets.SSH_KEY }} | |
script: webmention.io-backup |