-
Notifications
You must be signed in to change notification settings - Fork 2
95 lines (80 loc) · 2.55 KB
/
Copy pathrelease.yaml
File metadata and controls
95 lines (80 loc) · 2.55 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
92
93
94
95
name: Release
on:
release:
types: [ published, prereleased ]
concurrency:
group: release
cancel-in-progress: true
jobs:
prep:
name: Prepare
runs-on: ubuntu-latest
env:
TAG: ${{ github.event.release.tag_name }}
outputs:
version: ${{ steps.get-version.outputs.version }}
latest: ${{ steps.set-latest.outputs.latest }}
steps:
- name: Version Follows SemVer
run: |
if [[ ! "${TAG}" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+(-[[:alnum:].]+)?$ ]]; then
echo "Invalid SemVer: ${TAG}" >&2
exit 1
fi
- name: Get Version
id: get-version
run: |
VERSION=${TAG}
echo -n "version=${VERSION}" >> $GITHUB_OUTPUT
# only tag as latest if the release is set to latest
- name: set tag as latest
id: set-latest
run: |
LATEST="false"
if [ "${{ github.event.release.prerelease }}" == "false" ]; then
LATEST="true"
fi
echo -n "latest=${LATEST}" >> $GITHUB_OUTPUT
publish:
name: Build And Publish
runs-on: ubuntu-latest
permissions:
packages: write
needs: prep
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Dagger Build And Publish
uses: dagger/dagger-for-github@v8.4.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_USER: ${{ github.actor }}
VERSION: ${{ needs.prep.outputs.version }}
LATEST: ${{ needs.prep.outputs.latest }}
REPOSITORY: workday/cuestomize
PLATFORMS: linux/amd64,linux/arm64
with:
version: "0.21.7"
verb: call
args: build-and-publish --repository="$REPOSITORY" --version="$VERSION" --latest="$LATEST" --username="$GITHUB_USER" --password=env:GITHUB_TOKEN --platforms="$PLATFORMS"
publish-examples:
name: Publish Examples
runs-on: ubuntu-latest
permissions:
packages: write
needs: prep
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Run pipeline
uses: dagger/dagger-for-github@v8.4.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_USER: ${{ github.actor }}
REPOSITORY_PREFIX: ${{ github.repository }}/cuemodules/cuestomize-examples
VERSION: ${{ needs.prep.outputs.version }}
LATEST: ${{ needs.prep.outputs.latest }}
with:
version: "0.21.7"
verb: call
args: publish-examples --username="$GITHUB_USER" --password=env:GITHUB_TOKEN --version="$VERSION" --latest="$LATEST" --repositoryPrefix="$REPOSITORY_PREFIX"