upgrade golib: beamline sections/attributes order on web UI #73
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: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" # triggers only if push new tag version, like `0.8.4` or else | |
| permissions: write-all | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: "1.24" | |
| - name: Check out code into the Go module directory | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| # https://github.com/orgs/community/discussions/26686 | |
| - name: Branch name | |
| id: branch_name | |
| run: | | |
| echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/} | |
| echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/} | |
| echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/} | |
| # - name: Echo | |
| # run: | | |
| # echo ${{ steps.branch_name.outputs.SOURCE_NAME }} | |
| # echo ${{ steps.branch_name.outputs.SOURCE_BRANCH }} | |
| # echo ${{ steps.branch_name.outputs.SOURCE_TAG }} | |
| - name: Build | |
| env: | |
| GOPATH: /home/runner/go | |
| run: | | |
| make build_all | |
| tar cvfz databookkeeping.tar.gz srv* | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build image | |
| run: | | |
| make golib | |
| # use multi-stage build to run on mac ARM: | |
| # https://stackoverflow.com/questions/71000707/docker-get-started-warning-the-requested-images-platform-linux-arm64-v8-doe | |
| # https://github.com/docker/for-mac/issues/6356 | |
| # https://docs.docker.com/build/ci/github-actions/multi-platform/ | |
| # docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/chesscomputing/databookkeeping:${{ steps.branch_name.outputs.SOURCE_TAG }} . | |
| # build only on default (linux/amd64) platform as DBS needs C lib build | |
| # and it fails on arm64 due to database bindings | |
| docker buildx build --platform linux/amd64 -t ghcr.io/chesscomputing/databookkeeping:${{ steps.branch_name.outputs.SOURCE_TAG }} . | |
| - name: Login to ghcr.io registry | |
| uses: docker/login-action@v1.6.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish image | |
| uses: docker/build-push-action@v2 | |
| with: | |
| push: true | |
| #platforms: linux/amd64,linux/arm64 | |
| platforms: linux/amd64 | |
| tags: | | |
| ghcr.io/chesscomputing/databookkeeping:latest | |
| ghcr.io/chesscomputing/databookkeeping:${{ steps.branch_name.outputs.SOURCE_TAG }} | |
| - name: "✏️ Generate release changelog" | |
| uses: heinrichreimer/action-github-changelog-generator@v2.3 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create Release | |
| id: create_release | |
| uses: ncipollo/release-action@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: Release ${{ github.ref }} | |
| bodyFile: "LAST_CHANGES.md" | |
| draft: false | |
| prerelease: false | |
| - name: Upload binaries | |
| id: upload_binaries | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ./databookkeeping.tar.gz | |
| asset_name: databookkeeping.tar.gz | |
| asset_content_type: application/octet-stream | |