Slide 34
Slide 34 text
jobs
:
build
:
name: Buil
d
runs-on: ubuntu-20.0
4
steps
:
- name: Check ou
t
uses: actions/checkout@v
2
with
:
ref: ‘your_sha
'
- name: Set up JD
K
uses: actions/setup-java@v
1
with
:
java-version: 1
1
- name: Build with Gradl
e
run: ./gradlew assembleDebu
g
- name: Get apk pat
h
id: apk-pat
h
run: echo "::set-output name=path::$(find **/build/outputs/apk -name '*.apk'
-type f | head -1)
"
- name: Upload apk file to S
3
id: uploa
d
uses: hkusu/s3-upload-action@v
2
with
:
aws-access-key-id: ${{ secrets.ANDROID_CI_AWS_ACCESS_KEY_ID }
}
aws-secret-access-key: ${{ secrets.ANDROID_CI_AWS_SECRET_ACCESS_KEY }
}
aws-region: 'ap-northeast-1
'
aws-bucket: ${{ secrets.ANDROID_CI_AWS_BUCKET }
}
file-path: ${{ steps.apk-path.outputs.path }
}
output-file-url: 'true
'
content-type: 'application/vnd.android.package-archive
'
output-qr-url: 'true
'
- name: Get apk inf
o
id: apk-inf
o
uses: hkusu/apk-info-action@v
1
with
:
apk-path: ${{ steps.apk-path.outputs.path }
}
- name: Notif
y
uses: hkusu/slack-post-action@v
1
env
:
SLACK_APP_TOKEN: ${{ secrets.ANDROID_CI_SLACK_TOKEN }
}
with
:
channel: ‘your_slack_channel
’
message: '*Build Succeeded!*
'
color: 'good
'
report-sha: ‘your_sha
'
log-button: 'View log’
fields:
|
[
{
"title": "app name"
,
"value": "${{ steps.apk-info.outputs.application-name }}"
,
"short": tru
e
}
,
{
"title": "application ID"
,
"value": "${{ steps.apk-info.outputs.application-id }}"
,
"short": tru
e
}
,
{
"title": "build variant"
,
"value": "Debug"
,
"short": tru
e
}
,
{
"title": "version name (version code)"
,
"value": "${{ steps.apk-info.outputs.version-name }} (${{ steps.apk-
info.outputs.version-code }})"
,
"short": tru
e
}
,
{
"title": "min SDK version"
,
"value": "${{ steps.apk-info.outputs.min-sdk-version }}"
,
"short": tru
e
}
,
{
"title": "target SDK version (compile SDK version)"
,
"value": "${{ steps.apk-info.outputs.target-sdk-version }} ($
{{ steps.apk-info.outputs.compile-sdk-version }})"
,
"short": tru
e
}
,
{
"title": "apk file size"
,
"value": "${{ steps.apk-info.outputs.readable-file-size }}"
,
"short": tru
e
}
]
image: ${{ steps.upload.outputs.qr-url }
}
actions:
|
[
{
"type": "button"
,
"text": "Download apk"
,
"url": "${{ steps.upload.outputs.file-url }}
"
}
]
ϏϧυͷϫʔΫϑϩʔͷྫ