This repository was archived by the owner on Oct 11, 2025. It is now read-only.
updated go.mod, package now only does amd64 #19
Workflow file for this run
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 | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| build_success: ${{ steps.build_step.outputs.build_success }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.24.0' | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libpam0g-dev make | |
| - name: Build all binaries with Makefile | |
| id: build_step | |
| run: | | |
| make amd64 | |
| make package | |
| make aur | |
| echo "build_success=true" >> $GITHUB_OUTPUT | |
| continue-on-error: true | |
| - name: Print version info | |
| if: steps.build_step.outputs.build_success == 'true' | |
| run: | | |
| ./bin/fancylock-linux-amd64 -v || echo "Version info not available" | |
| - name: Check if build succeeded | |
| if: steps.build_step.outputs.build_success != 'true' | |
| run: exit 1 | |
| - name: Upload dist/ artifacts | |
| if: steps.build_step.outputs.build_success == 'true' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: fancylock-artifacts | |
| path: dist/ | |
| retention-days: 1 | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: needs.build.outputs.build_success == 'true' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: fancylock-artifacts | |
| path: dist/ | |
| - name: Get commit message for release notes | |
| id: get_release_notes | |
| run: | | |
| echo "release_notes<<EOF" >> $GITHUB_OUTPUT | |
| git log -1 --pretty=%B >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: Release ${{ github.ref_name }} | |
| body: ${{ steps.get_release_notes.outputs.release_notes }} | |
| files: dist/*.tar.gz | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Push to AUR | |
| run: | | |
| mkdir -p ~/.ssh | |
| echo "$AUR_SSH_KEY" > ~/.ssh/aur | |
| chmod 600 ~/.ssh/aur | |
| echo -e "Host aur.archlinux.org\n IdentityFile ~/.ssh/aur\n StrictHostKeyChecking no" >> ~/.ssh/config | |
| cd packages/aur/fancylock-bin | |
| git clone ssh://[email protected]/fancylock-bin.git aur-upstream | |
| cp -r aur-upstream/.git ./ | |
| rm -rf aur-upstream | |
| VERSION="${GITHUB_REF##*/}" | |
| VERSION="${VERSION#v}" | |
| sed "s/@VERSION@/$VERSION/g" PKGBUILD.template > PKGBUILD | |
| sed "s/@VERSION@/$VERSION/g" .SRCINFO.template > .SRCINFO | |
| git add PKGBUILD .SRCINFO | |
| git config user.email "aur@fancylock" | |
| git config user.name "FancyLock Bot" | |
| git commit -m "Release v$VERSION" | |
| git push origin master | |
| env: | |
| AUR_SSH_KEY: ${{ secrets.AUR_SSH_KEY }} | |