[英]Upload an apk file to Slack using github action
我正在嘗試使用 Github 將 APK 文件上傳到 Slack。 我的代碼以某種方式可以添加文本,但並沒有真正上傳實際的 apk 文件。 我正在使用 Flutter 構建 apk 文件。 我想要做的就是上傳一個 apk 文件,發送聊天通知也很棒..但似乎聊天通知已完成但無法上傳文件。
提前感謝您的幫助!
name: APK Deploy
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
# Setup Java environment in order to build the Android app.
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: '12.x'
# Setup the flutter environment.
- uses: subosito/flutter-action@v1
with:
channel: 'stable' # 'dev', 'alpha', default to: 'stable'
# flutter-version: '1.12.x' # you can also specify exact version of flutter
# Get flutter dependencies.
- run: flutter pub get
# Statically analyze the Dart code for any errors.
- run: flutter analyze .
# Run widget tests for our flutter project.
- run: flutter test
# Build apk.
- run: flutter build apk --release
- run: 'echo build/app/outputs/apk/release/app-release.apk > app-release.apk'
- uses: MeilCli/slack-upload-file@v1
with:
slack_token: ${{ secrets.SLACK_READ_WRITE_TOKEN }}
channels: ${{ secrets.SLACK_CHANNEL_DEPLOY }}
file_path: 'build/app/outputs/apk/release/app-release.apk'
file_name: 'app-release.apk'
file_type: 'apk'
initial_comment: '${{ github.ref }} - deployed the apk file to slack'
- name: action-slack
uses: 8398a7/action-slack@v3.8.0
with:
status: ${{ job.status }}
author_name: Build Notification
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
# Upload generated apk to the artifacts.
- name: release-apk
uses: actions/upload-artifact@v2
with:
name: app-release.apk
path: build/app/outputs/apk/release/app-release.apk
看起來你的問題可能在你的 release-apk 步驟中。 可能值得將其更改為:
path: ${{ github.workspace }}/app/actions_builds/app-release.apk
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.