-
Notifications
You must be signed in to change notification settings - Fork 158
92 lines (76 loc) · 2.8 KB
/
build.yml
File metadata and controls
92 lines (76 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Build
on:
workflow_call:
jobs:
prepare:
runs-on: ubuntu-latest-16-cores
if: github.repository_owner == 'armadaproject'
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Go
uses: ./.github/actions/setup-go-cache
with:
cache-prefix: prepare
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: v2.8.1
args: release --snapshot --skip=sbom,sign --clean
env:
DOCKER_REPO: "gresearch"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
DOCKER_BUILDX_BUILDER: "${{ steps.buildx.outputs.name }}"
- name: Output full commit sha
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/patch/v')) }}
run: echo "sha_full=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Save Docker image tarballs
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/patch/v')) }}
run: |
scripts/docker-save.sh -t ${{ env.sha_full }} -o /tmp/imgs
- name: Save Docker image tarballs as artifacts
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/patch/v')) }}
uses: actions/upload-artifact@v6
with:
name: armada-image-tarballs
path: /tmp/imgs
pack-nuget:
runs-on: ubuntu-latest
permissions: {}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- name: Setup the latest .NET 7 SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: 7.0.x
- name: Setup Go
uses: ./.github/actions/setup-go-cache
with:
cache-prefix: pack-nuget
cache-tools: true
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: '23.3'
- name: Create release tag
id: create-release-tag
run: echo "release_tag=$(git describe --tags --always --dirty --match='v*' 2> /dev/null | sed 's/^v//')" >> $GITHUB_OUTPUT
- name: Pack dotnet clients
env:
RELEASE_TAG: ${{ steps.create-release-tag.outputs.release_tag }}
run: go run github.com/magefile/mage@v1.15.0 -v packNuget
- name: Save nupkg artifacts
uses: actions/upload-artifact@v6
with:
name: nupkg-artifacts
path: |
./bin/client/DotNet/ArmadaProject.Io.Client.${{ steps.create-release-tag.outputs.release_tag }}.nupkg