-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (67 loc) · 2.82 KB
/
release.yml
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
name: Release - Package app
on:
release:
types: [created]
workflow_call:
inputs:
commit-ref:
required: true
type: string
secrets:
AIR_ACCESS_TOKEN:
required: true
PB_DISCORD_WEBHOOK:
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
if: github.event_name != 'repository_dispatch'
- uses: actions/checkout@v3
if: github.event_name == 'repository_dispatch'
with:
ref: main
fetch-depth: 5
- name: checkout ${{ inputs.commit-ref }}
run: git checkout ${{ inputs.commit-ref }}
- name: setup eli
uses: alis-is/setup-eli@v1
- name: Generate ID
id: repository_info
run: |
eli .github/get-variables.lua >> $GITHUB_OUTPUT
- name: Generate SHA256 and PACKAGE_SOURCE
working-directory: src
run: |
zip ../${{ steps.repository_info.outputs.ID }}-${{steps.repository_info.outputs.VERSION}}.zip -r *
- name: Upload files to a GitHub release
uses: svenstaro/upload-release-action@2.2.1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{steps.repository_info.outputs.VERSION}}
file: ${{ steps.repository_info.outputs.ID }}-${{steps.repository_info.outputs.VERSION}}.zip
- name: Generate SHA256 and PACKAGE_SOURCE
id: release_info
env:
ID: ${{ steps.repository_info.outputs.ID }}
VERSION: ${{steps.repository_info.outputs.VERSION}}
run: |
export SHA256=$(sha256sum $ID-$VERSION.zip | awk '{print $1}')
echo "SHA256=$SHA256" >> $GITHUB_OUTPUT
export PACKAGE_SOURCE=https://github.com/${{github.repository}}/releases/download/$VERSION/$ID-$VERSION.zip
echo "PACKAGE_SOURCE=$PACKAGE_SOURCE" >> $GITHUB_OUTPUT
- name: Air Repository Dispatch
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.AIR_ACCESS_TOKEN }}
repository: alis-is/air
event-type: app-release
client-payload: '{ "id": "${{ steps.repository_info.outputs.ID }}", "repository": "${{github.repository}}", "version": "${{steps.repository_info.outputs.VERSION}}", "package": "${{ steps.release_info.outputs.PACKAGE_SOURCE }}", "sha256": "${{ steps.release_info.outputs.SHA256 }}"}'
- name: Notify new version available
uses: Ilshidur/action-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.PB_DISCORD_WEBHOOK }}
VERSION: ${{steps.repository_info.outputs.VERSION}}
with:
args: "New ${{steps.repository_info.outputs.ID}} (ami package) **${{steps.repository_info.outputs.VERSION}}** released. (<https://github.com/tez-capital/ami-tezpay/releases/tag/${{steps.repository_info.outputs.VERSION}}>)"