-
Notifications
You must be signed in to change notification settings - Fork 5
82 lines (70 loc) · 3.02 KB
/
Copy pathpublish.yml
File metadata and controls
82 lines (70 loc) · 3.02 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
name: Publish Kobweb CLI to package managers
on:
workflow_dispatch:
inputs:
dryRun:
description: 'Dry run'
type: boolean
required: true
default: true
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 25
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
- name: Add secret Gradle properties
env:
GRADLE_PROPERTIES: ${{ secrets.VARABYTE_GRADLE_PROPERTIES }}
run: |
mkdir -p ~/.gradle/
echo "GRADLE_USER_HOME=${HOME}/.gradle" >> $GITHUB_ENV
echo "${GRADLE_PROPERTIES}" > ~/.gradle/gradle.properties
- name: Set dry run option
run: |
echo "kobweb.cli.jreleaser.dryrun=${{ github.event.inputs.dryRun }}" >> ~/.gradle/gradle.properties
# Force Gradle to run early so we don't capture the "Downloading Gradle" message in
# the output of our following steps
- name: Force Gradle download
run: ./gradlew --version
- name: Get Kobweb CLI Version
id: cli_version
run: |
echo "VERSION=$(./gradlew -q :kobweb:printVersion)" >> "$GITHUB_OUTPUT"
- name: Download Release Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CLI_VERSION: ${{ steps.cli_version.outputs.VERSION }}
run: |
ASSET_ZIP="kobweb-$CLI_VERSION.zip"
ASSET_TAR="kobweb-$CLI_VERSION.tar"
# Need to put files here so jreleaser can find them
ASSET_PATH="kobweb/build/distributions"
mkdir -p $ASSET_PATH
# Download assets using GitHub API
curl -sL -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/octet-stream" \
"$(curl -sL -H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/v$CLI_VERSION" | jq -r ".assets[] | select(.name==\"$ASSET_ZIP\").url")" \
-o "$ASSET_PATH/$ASSET_ZIP"
curl -sL -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/octet-stream" \
"$(curl -sL -H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/v$CLI_VERSION" | jq -r ".assets[] | select(.name==\"$ASSET_TAR\").url")" \
-o "$ASSET_PATH/$ASSET_TAR"
echo "Zip checksum $(sha256sum $ASSET_PATH/$ASSET_ZIP)"
echo "Tar checksum $(sha256sum $ASSET_PATH/$ASSET_TAR)"
- name: Publish Kobweb CLI to package managers
run: ./gradlew :kobweb:jreleaserPublish
- name: Update AUR Package
uses: varabyte/update-aur-package@v1.0.4
with:
dry_run: ${{ github.event.inputs.dryRun }}
version: ${{ steps.cli_version.outputs.VERSION }}
package_name: kobweb
commit_username: phi1309
commit_email: phi1309@protonmail.com
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}