Skip to content

Commit

Permalink
Upgrade to Dotnet 3.1 (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrcn committed Aug 10, 2021
1 parent e5fd265 commit 54b75dc
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 42 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/deploy-lambda.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build and Deploy

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build-deploy:
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v2
- name: setup-dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
- name: build
run: dotnet build
- name: install aws lambda tool
if: ${{ github.ref == 'refs/heads/master' }}
run: dotnet tool install -g Amazon.Lambda.Tools
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: deploy
if: ${{ github.ref == 'refs/heads/master' }}
run: ~/.dotnet/tools/dotnet-lambda deploy-serverless -tp 'TelegramAPIToken=${{ secrets.TELEGRAM_API_TOKEN }};KandilliPageUrl=${{ secrets.KANDILLI_PAGE_URL }}'
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion KandilliEarthquake.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution", "Solution", "{BD
ProjectSection(SolutionItems) = preProject
.gitattributes = .gitattributes
.gitignore = .gitignore
.travis.yml = .travis.yml
aws-lambda-tools-defaults.json = aws-lambda-tools-defaults.json
.github\workflows\deploy-lambda.yaml = .github\workflows\deploy-lambda.yaml
KandilliBotDiagram.png = KandilliBotDiagram.png
Readme.md = Readme.md
template.yml = template.yml
Expand Down
4 changes: 2 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# AWS Lambda - Kandilli Earthquake Notifier

[![Build Status](https://travis-ci.org/Geomates/KandilliEarthquakeNotifier.svg?branch=master)](https://travis-ci.org/Geomates/KandilliEarthquakeNotifier)
[![Build and Deploy](https://github.com/Geomates/KandilliEarthquakeNotifier/actions/workflows/deploy-lambda.yaml/badge.svg)](https://github.com/Geomates/KandilliEarthquakeNotifier/actions/workflows/deploy-lambda.yaml)

This project pulls the latest earthquakes from [Kandilli's website](http://www.koeri.boun.edu.tr) and pushes to a dedicated [Telegram channel](https://t.me/kandillisondepremler) and subscribers via Telegram Bot.

Expand All @@ -16,7 +16,7 @@ This project pulls the latest earthquakes from [Kandilli's website](http://www.k
![Diagram](./KandilliBotDiagram.png)

## Technology Stack
- .Net Core 2.1 - C#
- .Net Core 3.1 - C#
- [AWS Lambda](https://aws.amazon.com/lambda/)
- [AWS SQS](https://aws.amazon.com/sqs/)
- [AWS DynamoDB](https://aws.amazon.com/dynamodb/)
Expand Down
6 changes: 3 additions & 3 deletions src/Common/Common.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.4" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.4" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.17" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.17" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="S2Geometry" Version="1.0.3" />
</ItemGroup>
Expand Down
12 changes: 6 additions & 6 deletions src/KandilliEarthquakeBot/KandilliEarthquakeBot.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AWSProjectType>Lambda</AWSProjectType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Amazon.Lambda.APIGatewayEvents" Version="2.1.0" />
<PackageReference Include="Amazon.Lambda.Core" Version="1.1.0" />
<PackageReference Include="Amazon.Lambda.Serialization.Json" Version="1.7.0" />
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.3.106.16" />
<PackageReference Include="AWSSDK.Extensions.NETCore.Setup" Version="3.3.101" />
<PackageReference Include="Amazon.Lambda.APIGatewayEvents" Version="2.4.0" />
<PackageReference Include="Amazon.Lambda.Core" Version="2.0.0" />
<PackageReference Include="Amazon.Lambda.Serialization.Json" Version="2.0.0" />
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.0.50" />
<PackageReference Include="AWSSDK.Extensions.NETCore.Setup" Version="3.7.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.4" />
</ItemGroup>
<ItemGroup>
Expand Down
12 changes: 6 additions & 6 deletions src/KandilliEarthquakeNotifier/KandilliEarthquakeNotifier.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AWSProjectType>Lambda</AWSProjectType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Amazon.Lambda.Core" Version="1.1.0" />
<PackageReference Include="Amazon.Lambda.Serialization.Json" Version="1.7.0" />
<PackageReference Include="Amazon.Lambda.SQSEvents" Version="1.1.0" />
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.3.106.16" />
<PackageReference Include="AWSSDK.Extensions.NETCore.Setup" Version="3.3.101" />
<PackageReference Include="Amazon.Lambda.Core" Version="2.0.0" />
<PackageReference Include="Amazon.Lambda.Serialization.Json" Version="2.0.0" />
<PackageReference Include="Amazon.Lambda.SQSEvents" Version="2.0.0" />
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.0.50" />
<PackageReference Include="AWSSDK.Extensions.NETCore.Setup" Version="3.7.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.4" />
</ItemGroup>
<ItemGroup>
Expand Down
18 changes: 9 additions & 9 deletions src/KandilliEarthquakePuller/KandilliEarthquakePuller.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AWSProjectType>Lambda</AWSProjectType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Amazon.Lambda.CloudWatchEvents" Version="2.0.0" />
<PackageReference Include="Amazon.Lambda.Core" Version="1.1.0" />
<PackageReference Include="Amazon.Lambda.Serialization.Json" Version="1.7.0" />
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.3.106.16" />
<PackageReference Include="AWSSDK.Extensions.NETCore.Setup" Version="3.3.101" />
<PackageReference Include="AWSSDK.S3" Version="3.3.111.9" />
<PackageReference Include="AWSSDK.SQS" Version="3.3.102.123" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.24" />
<PackageReference Include="Amazon.Lambda.CloudWatchEvents" Version="3.0.0" />
<PackageReference Include="Amazon.Lambda.Core" Version="2.0.0" />
<PackageReference Include="Amazon.Lambda.Serialization.Json" Version="2.0.0" />
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.0.50" />
<PackageReference Include="AWSSDK.Extensions.NETCore.Setup" Version="3.7.1" />
<PackageReference Include="AWSSDK.S3" Version="3.7.1.21" />
<PackageReference Include="AWSSDK.SQS" Version="3.7.0.50" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.35" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.4" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.7.1" />
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Resources:
Properties:
FunctionName: KEarthquakeNotifier
Handler: KandilliEarthquakeNotifier::KandilliEarthquakeNotifier.Function::FunctionHandler
Runtime: dotnetcore2.1
Runtime: dotnetcore3.1
CodeUri: ./src/KandilliEarthquakeNotifier/
Description: Earthquake notifier to Telegram subscribers
MemorySize: 256
Expand All @@ -37,7 +37,7 @@ Resources:
Properties:
FunctionName: KEarthquakePuller
Handler: KandilliEarthquakePuller::KandilliEarthquakePuller.Function::FunctionHandler
Runtime: dotnetcore2.1
Runtime: dotnetcore3.1
CodeUri: ./src/KandilliEarthquakePuller/
Description: Earthquake puller and distributer. Pulls data from Kandilli website.
MemorySize: 256
Expand All @@ -63,7 +63,7 @@ Resources:
Properties:
FunctionName: KEarthquakeBot
Handler: KandilliEarthquakeBot::KandilliEarthquakeBot.Function::FunctionHandler
Runtime: dotnetcore2.1
Runtime: dotnetcore3.1
CodeUri: ./src/KandilliEarthquakeBot/
Description: Earthquake bot to notify subscribers based on their preferences.
MemorySize: 256
Expand Down

0 comments on commit 54b75dc

Please sign in to comment.