Skip to content

Commit c7d3513

Browse files
committed
Automatically update emails list
1 parent 2aa979d commit c7d3513

2 files changed

Lines changed: 106 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Releases
2+
3+
on:
4+
workflow_dispatch:
5+
#push:
6+
# tags:
7+
# - .*
8+
9+
jobs:
10+
release:
11+
name: Release new version
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Wait for tests
16+
uses: fountainhead/action-wait-for-check@v1.0.0
17+
id: wait-for-tests
18+
with:
19+
token: ${{ secrets.GITHUB_TOKEN }}
20+
checkName: Run dialyzer
21+
ref: ${{ github.ref }}
22+
timeoutSeconds: 3600
23+
24+
- name: Set up Elixir
25+
uses: erlef/setup-elixir@v1
26+
with:
27+
otp-version: "22.2"
28+
elixir-version: "1.9.4"
29+
30+
- name: Checkout
31+
uses: actions/checkout@v2
32+
33+
- name: Cache deps
34+
id: cache-deps
35+
uses: actions/cache@v2
36+
with:
37+
path: |
38+
deps
39+
_build
40+
key: deps-${{ runner.os }}-${{ hashFiles('**/mix.lock') }}-git-${{ github.sha }}
41+
restore-keys: |
42+
deps-${{ runner.os }}-${{ hashFiles('**/mix.lock') }}
43+
deps-${{ runner.os }}-$
44+
45+
- name: Install package dependencies
46+
run: mix deps.get
47+
48+
- name: Create release
49+
id: create_release
50+
uses: actions/create-release@v1
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
with:
54+
tag_name: ${{ github.ref }}
55+
release_name: Release ${{ github.ref }}
56+
draft: false
57+
prerelease: false
58+
59+
- name: Publish hex package
60+
run: mix hex.publish --yes
61+
env:
62+
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}

.github/workflows/sync.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Daily list sync
2+
3+
on:
4+
schedule:
5+
- cron: "30 15 * * *"
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
15+
- name: Download new list
16+
run: ./update_providers.sh
17+
18+
- name: Check for list changes
19+
continue-on-error: true
20+
id: changes
21+
run: git update-index --refresh && git diff-index HEAD
22+
23+
- name: Commit changes
24+
if: steps.changes.outcome != 'success'
25+
run: |
26+
git checkout main --
27+
git config user.email "benjamin@opencollective.com"
28+
git config user.name "Burnex Bot"
29+
git add priv/burner-email-providers/emails.txt
30+
31+
- name: Bump version
32+
if: steps.changes.outcome != 'success'
33+
run: |
34+
CURRENT_VERSION=`cat VERSION`
35+
NEW_PATCH=`echo $CURRENT_TAG | sed -E 's/v[0-9]+\.[0-9]+\.([0-9]+)/\1+1/' | bc`
36+
NEW_TAG=`echo $CURRENT_TAG | sed -E "s/(v[0-9]+\.[0-9]+\.)[0-9]+/\1$NEW_PATCH/"`
37+
echo $NEW_TAG > VERSION
38+
git commit -m "chore: updated domain list"
39+
git tag -a $NEW_TAG -m $NEW_TAG
40+
41+
- name: Push changes
42+
if: steps.changes.outcome != 'success'
43+
run: |
44+
git push --follow-tags

0 commit comments

Comments
 (0)