Skip to content

Commit 8692614

Browse files
authored
Use gh actions (#86)
* Use GH actions * Ditch circleci * Update `Developer.md`
1 parent 7ceca94 commit 8692614

File tree

4 files changed

+89
-98
lines changed

4 files changed

+89
-98
lines changed

.circleci/config.yml

-96
This file was deleted.

.github/workflows/pr.yaml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: New Relic - AWS Logs Ingestion - Pull Request
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
lint:
7+
strategy:
8+
matrix:
9+
python-version: ["3.9"]
10+
poetry-version: ["1.4"]
11+
os: [ubuntu-20.04]
12+
runs-on: ${{ matrix.os }}
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-python@v4
16+
with:
17+
python-version: ${{ matrix.python-version }}
18+
- name: Install Poetry
19+
uses: snok/install-poetry@v1
20+
with:
21+
poetry-version: ${{ matrix.poetry-version }}
22+
- name: Install Project
23+
run: poetry install --no-interaction
24+
- name: Lint
25+
run: |
26+
poetry run flake8 src test
27+
poetry run black --check src test
28+
test:
29+
strategy:
30+
matrix:
31+
python-version: ["3.9"]
32+
poetry-version: ["1.4"]
33+
os: [ubuntu-20.04, ubuntu-22.04]
34+
runs-on: ${{ matrix.os }}
35+
steps:
36+
- uses: actions/checkout@v3
37+
- uses: actions/setup-python@v4
38+
with:
39+
python-version: ${{ matrix.python-version }}
40+
- name: Install Poetry
41+
uses: snok/install-poetry@v1
42+
- name: Install Project
43+
run: poetry install --no-interaction
44+
- name: Test
45+
run: poetry run pytest

.github/workflows/release.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: New Relic - AWS Logs Ingestion - Release
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
release:
9+
strategy:
10+
matrix:
11+
python-version: ["3.9"]
12+
poetry-version: ["1.4"]
13+
os: [ubuntu-20.04, ubuntu-22.04]
14+
runs-on: ${{ matrix.os }}
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-python@v4
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install Poetry
21+
uses: snok/install-poetry@v1
22+
- name: Install Project
23+
run: poetry install --no-interaction
24+
- name: Test
25+
run: poetry run pytest
26+
- name: Configure AWS Credentials
27+
uses: aws-actions/configure-aws-credentials@v2
28+
with:
29+
role-to-assume: ${{ secrets.AWS_SAR_PUBLISHER_ROLE }}
30+
aws-region: us-east-1
31+
- name: Build & Package & Publish
32+
command: |
33+
poetry export -o src/requirements.txt --without-hashes
34+
poetry run sam validate
35+
poetry run sam build
36+
poetry run sam package --s3-bucket nr-serverless-applications --output-template-file packaged.yaml
37+
poetry run sam publish --region us-east-1 --template packaged.yaml
38+
39+

Developer.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010

1111
# Publishing a new version
1212

13-
To publish a new version [create a release](https://github.com/newrelic/aws-log-ingestion/releases/new)
14-
and specify a tag that matches the `SemanticVersion` that appears in the `template.yml`
13+
The version number needs to be bumped in `pyproject.toml` and `template.yaml` (in `Metadata.SemanticVersion`).
14+
Note that both should match.
15+
16+
Then, to publish a new version, [create a release](https://github.com/newrelic/aws-log-ingestion/releases/new)
17+
and specify a tag that matches the `SemanticVersion` that appears in `template.yml` (and `pyproject.toml`)
1518
but prefixed with a `v`. For example, if the `SemanticVersion` is `1.2.3` then your
1619
release tag should be `v1.2.3`.
1720

0 commit comments

Comments
 (0)