├── .eslintignore
├── .gitignore
├── .eslintrc.json
├── package.json
├── LICENSE
├── action.yml
└── README.md
/.eslintignore:
--------------------------------------------------------------------------------
1 | dist/
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 |
3 | # Logs
4 | logs
5 | *.log
6 | npm-debug.log*
7 | yarn-debug.log*
8 | yarn-error.log*
9 | lerna-debug.log*
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "commonjs": true,
4 | "es6": true,
5 | "jest": true,
6 | "node": true
7 | },
8 | "extends": "eslint:recommended",
9 | "globals": {
10 | "Atomics": "readonly",
11 | "SharedArrayBuffer": "readonly"
12 | },
13 | "parserOptions": {
14 | "ecmaVersion": 2018
15 | },
16 | "rules": {
17 | }
18 | }
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pinky",
3 | "version": "1.0.0",
4 | "description": "Flutter github action allows to auto submit apk or ipa file to various platform",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "jest",
8 | "prepare": "ncc build src/index.js --license licenses.txt -o src/dist --source-map"
9 | },
10 | "author": "",
11 | "license": "ISC",
12 | "dependencies": {
13 | "@actions/core": "^1.10.0",
14 | "@actions/github": "^5.1.1",
15 | "eslint": "^8.30.0",
16 | "form-data": "^4.0.0"
17 | },
18 | "devDependencies": {
19 | "@vercel/ncc": "^0.31.1",
20 | "jest": "^27.2.5"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Rexford Asamoah Agypong
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/action.yml:
--------------------------------------------------------------------------------
1 | name: 'Pinky Flutter'
2 | description: 'Flutter git action that makes you do more'
3 | branding:
4 | icon: 'heart'
5 | color: 'blue'
6 |
7 | inputs:
8 |
9 | flutter_version:
10 | description: 'Flutter version'
11 | required: false
12 | default: '3.3.3'
13 |
14 | flutter_channel:
15 | description: 'Flutter channel'
16 | required: false
17 | default: 'stable'
18 |
19 | path:
20 | description: 'Path to file'
21 | required: false
22 | default: build/app/outputs/flutter-apk/app-armeabi-v7a-debug.apk
23 |
24 | slack_token:
25 | description: 'Slack token'
26 | required: false
27 |
28 | telegram_token:
29 | description: 'Telegram token'
30 | required: false
31 |
32 | telegram_chat_id:
33 | description: 'Telegram chat id'
34 | required: false
35 |
36 | channel:
37 | description: 'Slack channels'
38 | required: false
39 |
40 | channel_id:
41 | description: "Slack channel's id"
42 | required: true
43 |
44 | filename:
45 | description: 'Filename of file'
46 | required: false
47 | default: 'pinky.apk'
48 |
49 | filetype:
50 | description: 'A file type identifier.'
51 | required: false
52 | default: 'apk'
53 |
54 | comment:
55 | description: 'The message text introducing the file in specified channels.'
56 | required: false
57 | default: 'New build'
58 |
59 | webhook_url:
60 | description: 'The webhook url to send the message to.'
61 | required: false
62 |
63 | usePicky:
64 | description: 'Indicate either you wanna use our picky bot'
65 | required: false
66 |
67 | web:
68 | description: 'Deploy Flutter web with git pages'
69 | required: false
70 | default: false
71 |
72 |
73 |
74 | runs:
75 | using: "composite"
76 | steps:
77 |
78 | - name: Spining Flutter 🦋
79 | uses: subosito/flutter-action@v2
80 | with:
81 | flutter-version: ${{inputs.flutter_version}}
82 | channel: ${{inputs.flutter_channel}}
83 |
84 | - name: Getting App Packages 🍎
85 | run: flutter pub get
86 | shell: bash
87 |
88 | - name: Building Flutter apk 👓
89 | run: flutter build apk --debug --split-per-abi
90 | shell: bash
91 |
92 | - name: Building Flutter Web ⛑️
93 | if: ${{ inputs.web == 'true' }}
94 | run: flutter build web
95 | shell: bash
96 |
97 |
98 | - name: Processing File 🛎️
99 | uses: rexthecoder/Pinky-Generator@1.7
100 | with:
101 | path: ${{inputs.path}}
102 | slack_token: ${{inputs.slack_token}}
103 | telegram_token: ${{inputs.telegram_token}}
104 | telegram_chat_id: ${{inputs.telegram_chat_id}}
105 | filename: ${{inputs.filename}}
106 | filetype: ${{inputs.filetype}}
107 | comment: ${{inputs.comment}}
108 | webhook_url: ${{inputs.webhook_url}}
109 | channel_id: ${{inputs.channel_id}}
110 | usePicky: ${{inputs.usePicky}}
111 |
112 | - name: Deploying web 🚀
113 | if: ${{ inputs.web == 'true' }}
114 | uses: JamesIves/github-pages-deploy-action@v4
115 | with:
116 | folder: build/web/
117 |
118 |
119 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Pinky Flutter Action
2 |
3 | Pinky allows you to deploy flutter apk to various platform at ease. Currently, we support.
4 |
5 | - Telegram
6 | - Slack
7 | - Discord
8 |
9 | ## Inputs
10 |
11 | | Name | Required | Description |
12 | |-----------------------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------|
13 | | flutter_version | `false` | Specify the current version of flutter your project uses |
14 | | flutter_channel | `false` | Specify the channel your project support |
15 | | path | `true` | Specify where your generated apk or ipa file is located |
16 | | slack_token | `false` | Your slack bot auth token |
17 | | telegram_token | `false` | Your telegram bot token generated by bot father |
18 | | telegram_chat_id | `false` | The id of the channel you want the apk to be send to |
19 | | channel_id | `false` | The slack channel name you want the apk to be send to |
20 | | filename | `false` | The name you want to give to the file |
21 | | comment | `false` | The message you want to attach to the file while sending it |
22 | | webhook_url | `false` | Your discord webhook url. |
23 | | usePicky | `false` | Indicate either you wanna use our picky bot |
24 | web | `false` | Indicate either you want to deploy the web file |
25 | ## Usage
26 |
27 | The following give you a preview of the set up
28 |
29 | `````yaml
30 | on: [push]
31 |
32 | jobs:
33 | runs-on: ubuntu-latest
34 | name: Pinky Test
35 | steps:
36 | - name: Checkout
37 | uses: actions/checkout@v3
38 | - name: Generate Flutter apk 🍻
39 | uses: ./
40 | with:
41 | slack_token: ${{ secrets.SLACK_TOKEN }}
42 | path: build/app/outputs/flutter-apk/app-release.apk
43 | channel: general
44 | filename: app-armeabi-v7a-debug.apk
45 | comment: "New Release"
46 | web: false
47 | channel_id: 'C03SQ349DHS'
48 | telegram_token: ${{ secrets.TELEGRAM_TOKEN }}
49 | telegram_chat_id: ${{ secrets.TELEGRAM_CHAT_ID }}
50 | webhook_url: ${{ secrets.WEBHOOK_URL }}
51 |
52 | `````
53 |
54 | ## Using Our Slack Bot
55 | - Set `usePicky` to true
56 |
57 | - Click on the below button
58 |
59 |
60 |
61 | - set the channel you added the bot to. eg. `channe_id:C03SQ349DHS`.
62 | You can check this [tutorial](https://help.socialintents.com/article/148-how-to-find-your-slack-team-id-and-slack-channel-id) incase you don't know how to get a channel id.
63 |
64 |
65 | ## Setting up Telegram
66 |
67 | > We planning to have our custom chatbot who does the work automatically.After the next update, you will automate things at ease.
68 |
69 |
70 | -
71 | Create a bot with BotFather.
72 |
73 | - Start a new conversation with the `BotFather`
74 |
75 | - Send /newbot to create a new Telegram bot.
76 |
77 | - When asked, enter a name for the bot.
78 |
79 | - Give the Telegram bot a unique username. Note that the bot name must end with the word "bot" (case-insensitive).
80 |
81 | - Copy and save the Telegram bot's access token for later steps.
82 |
83 |
84 |
85 |
86 | - Provide the access token to our `telegram_token`
87 |
88 | - Copy your channel id. The channel you want the apk to be sent to. ( Make sure the bot has been added over there).
89 |
90 |
91 | ## How to get Telegram channel id
92 |
93 | > Skip step 2 if your channel is public
94 |
95 | 1. log in under your account at web version of [`Telegram`](https://web.telegram.org). Incase your channel is public, just copy the channel name as the `telegram_chat_id`.
96 |
97 | 2. Find your channel. See to your URL. It should be like https://web.telegram.org/z/#-1543515057.
98 |
99 | 3. Grab "1543515057" from it, and add "-100" as a prefix.
100 |
101 |
102 | ## Setting up Discord
103 |
104 | > Note that, discord has file limit size(8mb) for channels which has no booster
105 |
106 | - Watch this [`video`](https://www.youtube.com/watch?v=wzdZLWonn0Y) to learn how to get your webhook.
107 | - Copy the webhook link and provide it to `webhook_url`
108 |
109 | That's all you need to get discord to work.
110 |
111 |
112 |
113 | Show some ❤️ and star the repo
114 |
115 |
116 |
117 |
--------------------------------------------------------------------------------