1
+ name : semver tag
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+
8
+ permissions :
9
+ contents : write
10
+ attestations : write
11
+ packages : write
12
+
13
+ env :
14
+ CRUSOE_CLOUD_CONTROLLER_MANAGER_NAME : ccm.crusoe.ai
15
+
16
+ jobs :
17
+ semver-tag :
18
+ runs-on : ubuntu-latest
19
+ steps :
20
+ - name : Checkout code
21
+ uses : actions/checkout@v3
22
+ with :
23
+ fetch-depth : 0
24
+
25
+ - name : Set up Git
26
+ run : |
27
+ git config user.name "crusoe-cloud"
28
+ git config user.email "support@crusoecloud.com"
29
+
30
+ - name : Load versions from text file
31
+ run : |
32
+ source versions.env
33
+ echo "MAJOR_VERSION=${MAJOR_VERSION}" >> $GITHUB_ENV
34
+ echo "MINOR_VERSION=${MINOR_VERSION}" >> $GITHUB_ENV
35
+
36
+ - name : Calculate and set new version
37
+ run : |
38
+ chmod +x ./scripts/tag_semver.sh
39
+ ./scripts/tag_semver.sh $MAJOR_VERSION $MINOR_VERSION ""
40
+ shell : bash
41
+
42
+ - name : Read version and push tag
43
+ run : |
44
+ source variables.env
45
+ echo "Calculated version: $RELEASE_VERSION"
46
+ source variables.env
47
+ git tag $RELEASE_VERSION
48
+ git push origin $RELEASE_VERSION
49
+ goreleaser :
50
+ needs : semver-tag
51
+ runs-on : ubuntu-latest
52
+ steps :
53
+ - uses : actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
54
+ with :
55
+ # Allow goreleaser to access older tag information.
56
+ fetch-depth : 0
57
+ - uses : actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
58
+ with :
59
+ go-version-file : ' go.mod'
60
+ cache : true
61
+ - name : Set up QEMU
62
+ uses : docker/setup-qemu-action@v3
63
+ - name : Set up Docker Buildx
64
+ uses : docker/setup-buildx-action@v3
65
+ - name : Login to GitHub Container Registry
66
+ uses : docker/login-action@v3
67
+ with :
68
+ registry : ghcr.io
69
+ username : ${{ github.actor }}
70
+ password : ${{ secrets.GITHUB_TOKEN }}
71
+ - name : Import GPG key
72
+ uses : crazy-max/ghaction-import-gpg@72b6676b71ab476b77e676928516f6982eef7a41 # v5.3.0
73
+ id : import_gpg
74
+ with :
75
+ gpg_private_key : ${{ secrets.GPG_PRIVATE_KEY }}
76
+ passphrase : ${{ secrets.PASSPHRASE }}
77
+ - name : Run GoReleaser
78
+ uses : goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
79
+ with :
80
+ args : release --clean
81
+ version : 2.1.x
82
+ env :
83
+ # GitHub sets the GITHUB_TOKEN secret automatically.
84
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
85
+ GPG_FINGERPRINT : ${{ steps.import_gpg.outputs.fingerprint }}
0 commit comments