Skip to content

Commit fd8281e

Browse files
committed
Added build action.
1 parent 50cb588 commit fd8281e

File tree

3 files changed

+84
-3
lines changed

3 files changed

+84
-3
lines changed

.github/workflows/build.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Get version from tag
13+
id: tag_name
14+
run: |
15+
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/}
16+
shell: bash
17+
- uses: actions/checkout@v2
18+
- name: Get Changelog Entry
19+
id: changelog_reader
20+
uses: mindsers/changelog-reader-action@v2
21+
with:
22+
validation_depth: 10
23+
version: ${{ steps.tag_name.outputs.current_version }}
24+
path: ./CHANGELOG.md
25+
- uses: actions/setup-node@v1
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
- name: Install node dependencies
29+
run: npm install
30+
- name: Set up Ruby 2.7
31+
uses: actions/setup-ruby@v1
32+
with:
33+
ruby-version: 2.7.2
34+
- uses: actions/cache@v1
35+
with:
36+
path: vendor/bundle
37+
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
38+
restore-keys: |
39+
${{ runner.os }}-gems-
40+
- name: Install gems
41+
run: |
42+
gem install bundler
43+
bundle config path vendor/bundle
44+
bundle install --standalone --path vendor/bundle --jobs 4 --retry 3
45+
- name: Create artifact
46+
run: |
47+
npx serverless package
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+
body: ${{ steps.changelog_reader.outputs.changes }}
57+
prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}
58+
draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }}
59+
- name: Upload Release Asset
60+
uses: actions/upload-release-asset@v1
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
with:
64+
upload_url: ${{ steps.create_release.outputs.upload_url }}
65+
asset_path: .serverless/s3-decompression-lambda.zip
66+
asset_name: s3-decompression-lambda.zip
67+
asset_content_type: application/zip

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog][1], and this project adheres to
6+
[Semantic Versioning][2].
7+
8+
## [1.0.0] - 2020-11-29
9+
10+
### Added
11+
12+
- Initial release.
13+
14+
[1]: https://keepachangelog.com/en/1.0.0/
15+
[2]: https://semver.org/spec/v2.0.0.html
16+
[1.0.0]: https://github.com/jamesiarmes/s3-decompression-lambda/releases/tag/1.0.0

serverless.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ functions:
1010
s3_decompression:
1111
description: Decompresses files from one S3 bucket and writes them to another.
1212
handler: functions/s3_decompression.lambda_handler
13-
package:
14-
include:
15-
- functions/s3_decompression.rb
1613
environment:
1714
DESTINATION_BUCKET: 'example-bucket'
1815
DESTINATION_EXTENSION: 'json'
@@ -22,6 +19,7 @@ functions:
2219
package:
2320
include:
2421
- lib/**
22+
- functions/**
2523

2624
plugins:
2725
- serverless-ruby-package

0 commit comments

Comments
 (0)