diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index b85c8cb2..25fa2118 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -9,13 +9,13 @@ jobs: name: Discord Notification runs-on: ubuntu-latest steps: - - run: wget https://raw.githubusercontent.com/rcdailey/trash-updater/master/ci/notify/discord_notify.py + - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: python-version: '3.x' - run: pip install discord-webhook - run: | - python discord_notify.py \ + python ci/notify/discord_notify.py \ '${{ github.event.release.tag_name }}' \ '${{ secrets.DISCORD_WEBHOOK }}' \ '${{ github.event.release.body }}' diff --git a/ci/notify/discord_notify.py b/ci/notify/discord_notify.py index b91de847..f9fa093d 100644 --- a/ci/notify/discord_notify.py +++ b/ci/notify/discord_notify.py @@ -34,14 +34,14 @@ embed.set_author( url='https://github.com/rcdailey/trash-updater', icon_url='https://github.com/rcdailey/trash-updater/blob/master/ci/notify/trash-icon.png?raw=true') -embed.add_embed_field(name='Linux (x64)', - value=f'[Download](https://github.com/rcdailey/trash-updater/releases/download/{version}/trash-linux-x64.zip)') - -embed.add_embed_field(name='Windows (x64)', - value=f'[Download](https://github.com/rcdailey/trash-updater/releases/download/{version}/trash-win-x64.zip)') - -embed.add_embed_field(name='MacOS (x64)', - value=f'[Download](https://github.com/rcdailey/trash-updater/releases/download/{version}/trash-osx-x64.zip)') +def add_links(os_name, archs, os): + url_base = f'https://github.com/rcdailey/trash-updater/releases/download/{version}' + download_links = ', '.join(f'[{arch}]({url_base}/trash-{os}-{arch}.zip)' for arch in archs) + embed.add_embed_field(name=os_name, value=f'[{download_links}]') + +add_links('Linux', ('x64', 'arm', 'arm64'), 'linux') +add_links('Windows', ('x64', 'arm64'), 'win') +add_links('MacOS', ('x64', 'arm64'), 'osx') webhook = DiscordWebhook(webhook_url) webhook.add_embed(embed)