mirror of
https://github.com/serhii-londar/open-source-mac-os-apps.git
synced 2024-11-21 23:20:22 +00:00
Setup CI
This commit is contained in:
parent
cb090f3996
commit
367ae86550
3 changed files with 34 additions and 9 deletions
|
@ -200,7 +200,7 @@ class ReadmeGenerator {
|
|||
|
||||
func generateReadme() {
|
||||
print("Start")
|
||||
guard let applicationsData = try? Data(contentsOf: URL(fileURLWithPath: FilePaths.apps .rawValue)) else { return }
|
||||
guard let applicationsData = try? Data(contentsOf: URL(fileURLWithPath: FilePaths.applications.rawValue)) else { return }
|
||||
guard let categoriesData = try? Data(contentsOf: URL(fileURLWithPath: FilePaths.categories.rawValue)) else { return }
|
||||
let jsonDecoder = JSONDecoder()
|
||||
guard let applicationsObject = try? jsonDecoder.decode(JSONApplications.self, from: applicationsData) else { return }
|
||||
|
@ -284,11 +284,9 @@ extension JSONApplication {
|
|||
}
|
||||
|
||||
enum FilePaths: String {
|
||||
case readme = "./README.md"
|
||||
case newReadme = "./NEWREADME.md"
|
||||
case apps = "./apps.json"
|
||||
case applications = "./applications.json"
|
||||
case categories = "./categories.json"
|
||||
case readme = "./../README.md"
|
||||
case applications = "./../applications.json"
|
||||
case categories = "./../categories.json"
|
||||
}
|
||||
|
||||
struct Constants {
|
22
.github/deploy.sh
vendored
Normal file
22
.github/deploy.sh
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [[ $TRAVIS_BRANCH != 'master' ]]
|
||||
then
|
||||
exit
|
||||
fi
|
||||
|
||||
git checkout master
|
||||
|
||||
git config user.name "serhii-londar"
|
||||
git config user.email "serhii.londar@gmail.com"
|
||||
|
||||
echo add readme
|
||||
git add README.md
|
||||
|
||||
echo commit
|
||||
git commit -m "Generate README"
|
||||
|
||||
echo push
|
||||
git push --quiet "https://${GITHUB_TOKEN}@github.com/serhii-londar/open-source-mac-os-apps.git" master:master > /dev/null 2>&1
|
11
.travis.yml
11
.travis.yml
|
@ -1,11 +1,16 @@
|
|||
language: ruby
|
||||
sudo: required
|
||||
language: swift
|
||||
osx_image: xcode10
|
||||
rvm:
|
||||
- 2.2
|
||||
before_script:
|
||||
- gem install awesome_bot
|
||||
- gem install danger
|
||||
script:
|
||||
- awesome_bot README.md -w https://matrix.org/blog/home/
|
||||
- awesome_bot applications.json -w https://matrix.org/blog/home/
|
||||
- danger
|
||||
after_success:
|
||||
- swift ./.github/ReadmeGenerator.swift
|
||||
- ./.github/deploy.sh
|
||||
notifications:
|
||||
email: false
|
||||
email: false
|
Loading…
Reference in a new issue