Skip to content

Commit

Permalink
Automatically update emails list
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfinus committed Mar 28, 2021
1 parent 2aa979d commit e923356
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Releases

on:
workflow_dispatch:
#push:
# tags:
# - .*

jobs:
release:
name: Release new version
runs-on: ubuntu-latest

steps:
- name: Wait for tests
uses: fountainhead/[email protected]
id: wait-for-tests
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: Run dialyzer
ref: ${{ github.ref }}
timeoutSeconds: 3600

- name: Set up Elixir
uses: erlef/setup-elixir@v1
with:
otp-version: "22.2"
elixir-version: "1.9.4"

- name: Checkout
uses: actions/checkout@v2

- name: Cache deps
id: cache-deps
uses: actions/cache@v2
with:
path: |
deps
_build
key: deps-${{ runner.os }}-${{ hashFiles('**/mix.lock') }}-git-${{ github.sha }}
restore-keys: |
deps-${{ runner.os }}-${{ hashFiles('**/mix.lock') }}
deps-${{ runner.os }}-$
- name: Install package dependencies
run: mix deps.get

- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Publish hex package
run: mix hex.publish --yes
env:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
45 changes: 45 additions & 0 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Daily list sync

on:
schedule:
- cron: "30 15 * * *"

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Download new list
run: ./update_providers.sh

- name: Check for list changes
continue-on-error: true
id: changes
run: git update-index --refresh && git diff-index HEAD

- name: Commit changes
if: steps.changes.outcome != 'success'
run: |
git checkout main --
git config user.email "[email protected]"
git config user.name "Burnex Bot"
git add priv/burner-email-providers/emails.txt
- name: Bump version
if: steps.changes.outcome != 'success'
run: |
CURRENT_VERSION=`cat VERSION`
NEW_PATCH=`echo $CURRENT_TAG | sed -E 's/v[0-9]+\.[0-9]+\.([0-9]+)/\1+1/' | bc`
NEW_TAG=`echo $CURRENT_TAG | sed -E "s/(v[0-9]+\.[0-9]+\.)[0-9]+/\1$NEW_PATCH/"`
echo $NEW_TAG > VERSION
git commit -m "chore: updated domain list"
git tag -a $NEW_TAG -m $NEW_TAG
- name: Push changes
if: steps.changes.outcome != 'success'
run: |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git push --follow-tags

0 comments on commit e923356

Please sign in to comment.