forked from armadaproject/armada
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (80 loc) · 2.86 KB
/
build.yml
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
92
93
94
95
name: Build
on:
workflow_call:
jobs:
prepare:
runs-on: ubuntu-latest-16-cores
if: github.repository_owner == 'armadaproject'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go (no caching)
uses: actions/setup-go@v4
with:
go-version: '1.20'
cache: false
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: v1.20.0
args: release --snapshot --skip-sbom --skip-sign --clean
env:
DOCKER_REPO: "gresearch"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
DOCKER_BUILDX_BUILDER: "${{ steps.buildx.outputs.name }}"
DOCKER_BUILDX_CACHE_FROM: "type=gha"
DOCKER_BUILDX_CACHE_TO: "type=gha,mode=max"
- name: Output full commit sha
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
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'
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'
uses: actions/upload-artifact@v3
with:
name: armada-image-tarballs
path: /tmp/imgs
pack-nuget:
runs-on: ubuntu-latest
permissions: {}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-tags: true
- name: Setup the latest .NET 7 SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Set up Go (no caching)
uses: actions/setup-go@v4
with:
go-version: '1.20'
cache: false
- name: Install Protoc
uses: arduino/setup-protoc@v2
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/[email protected] -v packNuget
- name: Save nupkg artifacts
uses: actions/upload-artifact@v3
with:
name: nupkg-artifacts
path: |
./bin/client/DotNet/G-Research.Armada.Client.${{ steps.create-release-tag.outputs.release_tag }}.nupkg
./bin/client/DotNet/ArmadaProject.Io.Client.${{ steps.create-release-tag.outputs.release_tag }}.nupkg