From 093b7d8532f5662d7f9e7a05d98d74d75dbdf314 Mon Sep 17 00:00:00 2001 From: Surax98 Date: Tue, 2 Apr 2024 09:48:58 +0000 Subject: [PATCH] actions test --- .github/workflows/build-image.yml | 39 ++++++++++++++++++++++++++++ .github/workflows/goreleaser.yaml | 37 ++++++++++++++++++++++++++ .goreleaser.yaml | 43 +++++++++++++++++++++++++++++++ 3 files changed, 119 insertions(+) create mode 100644 .github/workflows/build-image.yml create mode 100644 .github/workflows/goreleaser.yaml create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml new file mode 100644 index 0000000..caaafe6 --- /dev/null +++ b/.github/workflows/build-image.yml @@ -0,0 +1,39 @@ +name: build-image + +on: + push: + tags: + - "*" +jobs: + slurm-sidecar: + runs-on: ubuntu-latest + #env: + # DOCKER_TARGET_PLATFORM: linux/arm64 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set env + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Get Repo Owner + id: get_repo_owner + run: echo ::set-output name=repo_owner::$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') + - name: Build container base image + uses: docker/build-push-action@v5 + with: + context: ./ + outputs: "type=registry,push=true" + tags: | + ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/interlink-sidecar-slurm:${{ env.RELEASE_VERSION }} + ghcr.io/${{ steps.get_repo_owner.outputs.repo_owner }}/interlink-sidecar-slurm:latest + file: ./docker/Dockerfile.vk + platforms: linux/amd64, linux/arm64 \ No newline at end of file diff --git a/.github/workflows/goreleaser.yaml b/.github/workflows/goreleaser.yaml new file mode 100644 index 0000000..cef0c25 --- /dev/null +++ b/.github/workflows/goreleaser.yaml @@ -0,0 +1,37 @@ +name: goreleaser + +on: + push: + # run only against tags + tags: + - '*' + +permissions: + contents: write + # packages: write + # issues: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - run: git fetch --force --tags + - uses: actions/setup-go@v5 + with: + go-version: stable + # More assembly might be required: Docker logins, GPG, etc. It all depends + # on your needs. + - uses: goreleaser/goreleaser-action@v5 + with: + # either 'goreleaser' (default) or 'goreleaser-pro': + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Your GoReleaser Pro key, if you are using the 'goreleaser-pro' + # distribution: + # GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..64d1416 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,43 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com +before: + hooks: + # You may remove this if you don't use go modules. + - go mod tidy +builds: + - id: "interlink-sidecar-slurm" + binary: interlink-sidecar-slurm + env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + goarch: + - arm64 + - amd64 + - ppc64le + main: ./cmd/sidecars/slurm +archives: + - name_template: >- + {{ .Binary }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "linux" }}Linux + {{- else if eq .Arch "darwin" }}MacOS + {{- else }}{{ .Arch }}{{ end }} + format: binary + +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ incpatch .Version }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs_new:' + - '^test:' + +# modelines, feel free to remove those if you don't want/use them: +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj