name: tweet
on:
  workflow_dispatch:
  release:
    types: [published]
defaults:
  run: { shell: bash }

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - uses: actions/setup-python@v2
      with: {python-version: '3.8'}
    - name: Run script
      env:
        CONTEXT_GITHUB: ${{ toJson(github) }}
        CONTEXT_SECRETS: ${{ toJson(secrets) }}
      run: |
        pip install -Uq tweetrel
        python .github/scripts/build-tweet.py
