[AUTO] new release #61
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update adlist | |
on: | |
push: | |
paths: | |
- 'release-versions/*' | |
workflow_dispatch: | |
jobs: | |
update-list: | |
runs-on: ubuntu-latest | |
if: github.event.commits[0].message == '[AUTO] new release' | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Run script | |
run: python merge_ads.py | |
- name: Get short SHA | |
id: vars | |
run: | | |
calculatedSha=$(git rev-parse --short ${{ github.sha }}) | |
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | |
with: | |
tag_name: v${{ env.COMMIT_SHORT_SHA }} | |
release_name: Release ${{ steps.vars.outpusts.sha_short }} | |
draft: false | |
prerelease: false | |
- name: Upload release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ad_list.txt | |
asset_name: ad_list.txt | |
asset_content_type: text/plain | |