fix flag #4
This file contains hidden or 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: build-and-release | |
| on: | |
| push: | |
| branches: [ 'main' ] | |
| tags: [ 'v*.*.*' ] | |
| pull_request: | |
| branches: [ 'main' ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| release: | |
| if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' | |
| outputs: | |
| version: ${{ steps.release.outputs.version }} | |
| name: Make Release Assets | |
| runs-on: ubuntu-latest | |
| env: | |
| GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| # we need the whole thing so we can count commits. | |
| fetch-depth: '0' | |
| - name: make-release | |
| id: release | |
| run: | | |
| sudo apt install -y fakeroot zip debsigs gnupg jq | |
| sudo gem install --no-document fpm | |
| echo "${GPG_SIGNING_KEY}" | gpg --import - | |
| mkdir -p root/etc/fogwillow root/lib/systemd/system root/usr/bin | |
| CGO_ENABLED=0 go build -trimpath -mod=readonly -modcacherw -o root/usr/bin/fogwillow -ldflags "-w -s" . | |
| cp fog.conf root/etc/fogwillow/fog.conf | |
| cp package/fogwillow.service root/lib/systemd/system/fogwillow.service | |
| bash package/package.sh | |
| mkdir release | |
| mv *.deb release | |
| - name: upload artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: release | |
| path: release | |
| deploy-nonpublic-packagecloud: | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: release | |
| name: Deploy Nonpublic PackageCloud | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download release files | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: release | |
| - uses: golift/upload-packagecloud@v1.1 | |
| with: | |
| userrepo: golift/nonpublic | |
| apitoken: ${{ secrets.PACKAGECLOUD_TOKEN }} | |
| packages: . | |
| debdists: ubuntu/focal |