Skip to content

Commit 9523021

Browse files
benjbenoguzhanunlu
authored andcommitted
Migrate to Github Action
1 parent 8eb1c63 commit 9523021

17 files changed

+75
-263
lines changed

.github/workflows/lib/yaml_to_json.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import sys
2+
import yaml
3+
import json
4+
5+
with open(sys.argv[1], 'r') as input:
6+
yml = yaml.safe_load(input)
7+
8+
with open(sys.argv[2], 'w') as output:
9+
json.dump(yml, output)
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- test*
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Convert yaml to json
14+
run: python .github/workflows/lib/yaml_to_json.py resources/referers.yml referers.json
15+
- name: Get datetime
16+
id: datetime
17+
run: echo "datetime=$(date "+%Y-%m-%d-%H%M%S")" >> $GITHUB_OUTPUT
18+
- name: Tag
19+
run: git tag ${{ steps.datetime.outputs.datetime }} && git push --tags
20+
- name: Create GitHub release and attach referers.json
21+
uses: softprops/action-gh-release@v1
22+
with:
23+
tag_name: ${{ steps.datetime.outputs.datetime }}
24+
files: ./referers.json

.github/workflows/release.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Get date
14+
id: date
15+
run: echo "date=$(date "+%Y%m%d")" >> "$GITHUB_ENV"
16+
- name: Convert yaml to json
17+
run: python .github/workflows/lib/yaml_to_json.py resources/referers.yml referers-${{ steps.date.outputs.date }}.json
18+
- name: Tag
19+
run: git tag ${{ steps.date.outputs.datetime }} && git push --tags
20+
- name: Create GitHub release and attach referers.json
21+
uses: softprops/action-gh-release@v1
22+
with:
23+
tag_name: ${{ steps.date.outputs.date }}
24+
files: ./referers-${{ steps.date.outputs.date }}.json

.github/workflows/test.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: test
2+
3+
on: pull_request
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- name: Convert yaml to json
11+
run: python .github/workflows/lib/yaml_to_json.py resources/referers.yml referers.json
12+
- name: Check
13+
run: cat referers.json

.gitignore

-17
This file was deleted.

.travis.yml

-3
This file was deleted.

CHANGELOG

-17
This file was deleted.

README.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,16 @@ The latest database is always available on this URL:
1717
https://s3-eu-west-1.amazonaws.com/snowplow-hosted-assets/third-party/referer-parser/referers-latest.yaml
1818
https://s3-eu-west-1.amazonaws.com/snowplow-hosted-assets/third-party/referer-parser/referers-latest.json
1919

20-
The database is updated at most once a month. Each new version of the database is also uploaded with a timestamp:
20+
The database is updated every day. Each new version of the database is also uploaded with a timestamp:
2121

2222
https://s3-eu-west-1.amazonaws.com/snowplow-hosted-assets/third-party/referer-parser/referers-YYYYMMDD.yaml
2323
https://s3-eu-west-1.amazonaws.com/snowplow-hosted-assets/third-party/referer-parser/referers-YYYYMMDD.json
2424

2525
Example:
26+
2627
https://s3-eu-west-1.amazonaws.com/snowplow-hosted-assets/third-party/referer-parser/referers-20200331.yaml
2728
https://s3-eu-west-1.amazonaws.com/snowplow-hosted-assets/third-party/referer-parser/referers-20200331.json
2829

29-
If there is an issue with the database necessitating a re-release within the month, the corresponding files will be overwritten.
30-
3130
## Language-specific repositories
3231

3332
- Scala: https://github.com/snowplow-referer-parser/scala-referer-parser
@@ -78,9 +77,7 @@ We welcome contributions to referer-parser:
7877

7978
## Support
8079

81-
General support for referer-parser is handled by the team at Snowplow Analytics Ltd.
82-
83-
You can contact the Snowplow Analytics team through any of the [channels listed on their wiki][talk-to-us].
80+
General support for `referer-parser` is handled by Snowplow Analytics team on [discourse][discourse].
8481

8582
## Copyright and license
8683

@@ -90,6 +87,8 @@ You can contact the Snowplow Analytics team through any of the [channels listed
9087

9188
[snowplow]: https://github.com/snowplow/snowplow
9289

90+
[discourse]: https://discourse.snowplow.io
91+
9392
[piwik]: http://piwik.org
9493
[piwik-search-engines]: https://github.com/piwik/piwik/blob/master/core/DataFiles/SearchEngines.php
9594
[piwik-socials]: https://github.com/piwik/piwik/blob/master/core/DataFiles/Socials.php

Vagrantfile

-19
This file was deleted.

composer.json

-23
This file was deleted.

sync_data.py

-103
This file was deleted.

vagrant/.gitignore

-3
This file was deleted.

vagrant/ansible.hosts

-2
This file was deleted.

vagrant/peru.yaml

-14
This file was deleted.

vagrant/up.bash

-50
This file was deleted.

vagrant/up.guidance

-3
This file was deleted.

vagrant/up.playbooks

-3
This file was deleted.

0 commit comments

Comments
 (0)