-
Notifications
You must be signed in to change notification settings - Fork 8
65 lines (58 loc) · 1.82 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Release Automation
on:
workflow_dispatch:
inputs:
version-bump:
description: The scale of the version bump required for semver compatibility
required: true
default: patch
type: choice
options:
- patch
- minor
- major
concurrency: release
jobs:
release:
name: "Release & Publish"
runs-on: ubuntu-latest
steps:
- name: 🧮 Checkout code
uses: actions/checkout@v3
with:
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
- name: 🔧 Set up node environment
uses: actions/setup-node@v3
with:
cache: 'yarn'
- name: 🗜️ Set up python environment
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: 🔨 Install Poetry
uses: snok/install-poetry@v1
- name: 🛠️ Setup
run: "./scripts/setup.sh"
- name: 👊 Bump version
run: |
yarn version --no-git-tag-version --${{ github.event.inputs.version-bump }}
git config --global user.name 'ElementRobot'
git config --global user.email 'releases@riot.im'
git commit -am "${{ github.event.inputs.version-bump }} version bump"
git push
- name: 🚀 Publish to npm
id: npm-publish
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
- name: 🧬 Create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.npm-publish.outputs.version }}
release_name: Release ${{ steps.npm-publish.outputs.version }}
body: ${{ steps.npm-publish.outputs.version }} Release
draft: false
prerelease: false