Update script and beta workflow #101
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: Threadfin Beta Build | |
on: | |
push: | |
branches: | |
- beta | |
permissions: | |
contents: write | |
jobs: | |
buildBinaries: | |
name: Build and release binaries | |
runs-on: ubuntu-latest | |
outputs: | |
new_version: ${{ steps.set-build-number.outputs.new_version }} | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
with: | |
ref: beta | |
- name: Set build number | |
id: set-build-number | |
run: | | |
bash ${GITHUB_WORKSPACE}/Utility/set_buildnumber.sh ${{ vars.BUILD_NUMBER }} | |
- name: Update repo variable | |
run: | | |
bash ${GITHUB_WORKSPACE}/Utility/update_buildnumber_variable.sh ${{ secrets.API_TOKEN }} ${{ github.repository }} ${{ env.new_version }} | |
- name: Set up and Build | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.23 | |
id: go | |
- name: Build binaries | |
run: | | |
go mod tidy && go mod vendor | |
bash ${GITHUB_WORKSPACE}/Utility/create_binaries.sh beta | |
- name: Create a Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
prerelease: true | |
name: v${{ env.new_version }} (Beta) | |
tag_name: v${{ env.new_version }}-beta | |
files: dist/* | |
buildDockerImages: | |
name: Build and push Docker images | |
runs-on: ubuntu-latest | |
needs: buildBinaries | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set NEW_VERSION | |
run: echo "NEW_VERSION=${{ needs.buildBinaries.outputs.new_version }}" >> $GITHUB_ENV | |
shell: bash | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Docker Build and Push | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
build-args: | | |
BRANCH=beta | |
VERSION=${{ env.NEW_VERSION }} | |
push: true | |
no-cache: true | |
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8 | |
tags: | | |
mgoerentz/threadfin:${{ env.NEW_VERSION }}-beta | |
mgoerentz/threadfin:latest-beta |