-
-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (81 loc) · 2.77 KB
/
android-ci.yml
File metadata and controls
91 lines (81 loc) · 2.77 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
name: Android CI
on:
workflow_dispatch:
push:
# branches: [ master ]
paths-ignore:
- '**/README.md'
- 'screenshots/**'
- '.gitignore'
- '.idea/**'
- '.run/**'
tags:
- "[0-9]+.[0-9]+.[0-9]+"
jobs:
build:
name: 🎉 Build Android Library
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
# https://github.com/actions/checkout
- name: 🚚 Get latest code
uses: actions/checkout@v4
with:
# Mandatory to get the extract version from tag.
fetch-depth: 0
# https://github.com/actions/setup-java
- name: ☕ Set up JDK
uses: actions/setup-java@v4
with:
architecture: x64
distribution: corretto
java-version: '17'
# https://github.com/gradle/actions/blob/main/docs/setup-gradle.md
- name: 🐘 Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-encryption-key: ${{ SECRETS.GRADLE_ENCRYPTION_KEY }}
cache-cleanup: always
- name: 🐘 Publish AAR to GPR
env:
GITHUB_ACTOR: ${{ GITHUB.REPOSITORY_OWNER }}
GITHUB_TOKEN: ${{ SECRETS.GITHUB_TOKEN }}
run: |
chmod +x ./gradlew
export VERSION=$(git for-each-ref refs/tags --sort=-refname --format='%(refname:short)' --count=1)
./gradlew --max-workers=2 :androidx-github:lint :androidx-github:publishLibraryPublicationToGitHubPackagesRepository
ls -la ./library/build/outputs/aar | grep aar
# https://github.com/actions/upload-artifact
- name: 📦 Retain Artifacts (AAR)
id: retain-library-aar
uses: actions/upload-artifact@v4
with:
name: androidx-github
path: ./library/build/outputs/aar/*.aar
retention-days: 14
# https://github.com/actions/upload-artifact
- name: 📦 Retain Artifacts (Lint Results)
id: retain-lint-results
uses: actions/upload-artifact@v4
with:
name: androidx-github-lint
path: ./library/build/reports/*
retention-days: 14
# - name: 🐘 Publish JAR to GPR
# env:
# GITHUB_ACTOR: ${{ GITHUB.REPOSITORY_OWNER }}
# GITHUB_TOKEN: ${{ SECRETS.GITHUB_TOKEN }}
# run: |
# # PUT -> HTTP 403
# # ./gradlew --max-workers=2 :buildSrc:publishPluginPublicationToGitHubPackagesRepository
# ./gradlew --max-workers=2 :buildSrc:build
# ls -la ./buildSrc/build/libs | grep jar
# - name: 📦 Retain Artifacts (JAR)
# id: retain-library-jar
# uses: actions/upload-artifact@v4
# with:
# name: gpr-maintenance-gradle-plugin
# path: ./buildSrc/build/libs/*.jar
# retention-days: 14