Skip to content

Commit 4eae3ac

Browse files
committed
chore: add release build
1 parent 417beee commit 4eae3ac

File tree

3 files changed

+48
-2
lines changed

3 files changed

+48
-2
lines changed

.github/workflows/zip-release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: zip-release
2+
on:
3+
push:
4+
tags:
5+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
6+
7+
jobs:
8+
build:
9+
# only allow on main or tags
10+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v2
15+
- name: Create zip
16+
uses: papeloto/action-zip@v1
17+
with:
18+
files: index.js
19+
dest: release.zip
20+
- name: Create Release
21+
id: create_release
22+
uses: actions/create-release@v1
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
with:
26+
tag_name: ${{ github.ref }}
27+
release_name: Release ${{ github.ref }}
28+
draft: false
29+
prerelease: false
30+
- name: Upload Release Asset
31+
id: upload-release-asset
32+
uses: actions/upload-release-asset@v1
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
with:
36+
# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
37+
upload_url: ${{ steps.create_release.outputs.upload_url }}
38+
asset_path: ./release.zip
39+
asset_name: release.zip
40+
asset_content_type: application/zip

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 🚀🤖 Rocketbot
22

3-
![build](https://github.com/canva-public/rocketbot/actions/workflows/node.js.yml/badge.svg)
3+
[![build](https://github.com/canva-public/rocketbot/actions/workflows/node.js.yml/badge.svg)](https://github.com/canva-public/rocketbot/actions/workflows/node.js.yml)
44

55
This lambda provides a bridge between github and Buildkite, allowing you to trigger a Buildkite build from a comment on a pull request on github.
66

@@ -81,3 +81,9 @@ and then you can run the tests as usual with `yarn test` or kick them in watch m
8181
### Debugging hints
8282

8383
Use `ENABLE_DEBUG=true DEBUG=nock.* yarn test:watch` and `.only` in the tests to see output and assertions from nock.
84+
85+
## Releasing
86+
87+
- Tag a commit with a tag following the pattern `vX.X.X` (where `X.X.X` is the new to-be-releases semver of the package).
88+
- This will create a new release and attach a zip file to it.
89+
- After, please add as much detail as possible to the release description.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@canva/rocketbot",
2+
"name": "@canva-public/rocketbot",
33
"version": "1.0.0",
44
"description": "A lambda function to enable comment-driven actions via github",
55
"main": "index.js",

0 commit comments

Comments
 (0)