Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically update emails list #66

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Releases

on:
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: All done
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: softprops/action-gh-release@v1
with:
token: ${{ secrets.PERSONAL_TOKEN }}
draft: false
prerelease: false

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

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

jobs:
build:
runs-on: ubuntu-latest

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

- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.PERSONAL_TOKEN }}

- 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 master --
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_VERSION | sed -E 's/v?[0-9]+\.[0-9]+\.([0-9]+)/\1+1/' | bc`
NEW_VERSION=`echo $CURRENT_VERSION | sed -E "s/(v?[0-9]+\.[0-9]+\.)[0-9]+/\1$NEW_PATCH/"`
echo $NEW_VERSION > VERSION
git add VERSION
git commit -m "chore: updated domain list"
git tag -a $NEW_VERSION -m $NEW_VERSION

- name: Push changes
if: steps.changes.outcome != 'success'
run: |
git push
git push --tags
17 changes: 15 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Test

on:
push:
branches:
- '**'
pull_request:
branches:
- master
Expand All @@ -17,9 +19,10 @@ jobs:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
concurrent_skipping: always
github_token: ${{ secrets.GITHUB_TOKEN }}
concurrent_skipping: same_content_newer
cancel_others: true
skip_after_successful_duplicate: true
skip_after_successful_duplicate: false
paths_ignore: '["**/README.md", "**/CHANGELOG.md", "**/LICENSE"]'
do_not_skip: '["pull_request"]'

Expand Down Expand Up @@ -155,3 +158,13 @@ jobs:

- name: Run dialyzer
run: mix dialyzer

done:
name: All done
needs: [credo, dialyzer]
runs-on: ubuntu-latest

steps:

- name: All done
run: echo Done