Skip to content

0.4.0+0.17.0-beta

0.4.0+0.17.0-beta #11

Workflow file for this run

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}}>)"