-
-
Notifications
You must be signed in to change notification settings - Fork 2
136 lines (118 loc) · 4.03 KB
/
release.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Release
on:
push:
branches: ['main']
concurrency: ${{ github.workflow }}-${{ github.ref }}
env:
JAVA_VERSION: 21
NODE_VERSION: 20
permissions:
issues: write
contents: write
pull-requests: write
jobs:
release:
name: Release Changeset
runs-on: ubuntu-latest
outputs:
published: ${{ steps.changesets.outputs.published }}
publishedPackages: ${{ steps.changesets.outputs.publishedPackages }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: 'Set up Java ${{ env.JAVA_VERSION }}'
uses: actions/setup-java@v4
with:
java-version: '${{ env.JAVA_VERSION }}'
distribution: 'zulu'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: ${{ github.event_name == 'pull_request' }}
build-scan-publish: true
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-use-agree: "yes"
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '${{ env.NODE_VERSION }}'
- name: Initialize Node.js
run: npm ci
- name: Load Organization gradle.properties
env:
props: ${{ secrets.GRADLE_IGNITION_MODULE_SIGNING_PROPS }}
run: |
mkdir -p ~/.gradle/
echo "GRADLE_USER_HOME=${HOME}/.gradle" >> $GITHUB_ENV
echo "${props}" > ~/.gradle/gradle.properties
- name: Load Organization Signing Cert
run: |
mkdir ./secrets
echo -n "$cert_base64" | base64 --decode > ./secrets/cert.p7b
env:
cert_base64: ${{ secrets.IGNITION_MODULE_CERT_BASE64 }}
- name: Load Organization Keystore
run: |
echo -n "$keystore_base64" | base64 --decode > ./secrets/keystore.jks
env:
keystore_base64: ${{ secrets.IGNITION_MODULE_KEYSTORE_BASE64 }}
- name: Publish on Version Change
id: changesets
uses: changesets/action@v1
with:
publish: ./gradlew release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Archive build artifacts
uses: actions/upload-artifact@v4
with:
name: build
path: |
./build/
publish-gha:
name: Publish to GitHub Releases
runs-on: ubuntu-latest
needs: release
if: needs.release.outputs.published == 'true'
strategy:
fail-fast: true
matrix:
package: ${{ fromJson(needs.release.outputs.publishedPackages) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: build
path: ./build
- name: Get Tag Name
id: meta
run: |
echo "tag_name=${{ matrix.package.name }}@${{ matrix.package.version }}" >> "$GITHUB_OUTPUT"
- name: Publish Artifacts to Releases
run: |
gh release upload ${{ steps.meta.outputs.tag_name }} ./build/modules/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
dependency-submission:
runs-on: ubuntu-latest
name: 'Submit dependencies'
steps:
- uses: actions/checkout@v4
- name: 'Set up Java ${{ env.JAVA_VERSION }}'
uses: actions/setup-java@v4
with:
java-version: '${{ env.JAVA_VERSION }}'
distribution: 'zulu'
- name: 'Make gradlew executable'
run: chmod +x ./gradlew
# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
- name: 'Generate and submit dependency graph'
uses: gradle/actions/dependency-submission@v4