-
Notifications
You must be signed in to change notification settings - Fork 11
69 lines (59 loc) · 2.11 KB
/
release.yml
File metadata and controls
69 lines (59 loc) · 2.11 KB
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
66
67
68
69
name: Release NPM packages
env:
NX_MAX_PARALLEL: 2
on:
workflow_dispatch:
inputs:
target_project:
type: 'choice'
description: 'The target project to release.'
required: true
options:
- utils
- ng-utils
- route-config
- cypress-indexeddb
- rxidb
- vue-route-guard
release_as:
type: 'choice'
description: 'The release type. It can be one of: major, minor, patch, premajor, preminor, prepatch, or prerelease. Defaults to "patch"'
required: true
default: 'patch'
options:
- major
- minor
- patch
- premajor
- preminor
- prepatch
- prerelease
jobs:
release:
runs-on: ubuntu-latest
# This next line locks this workflow to the main branch, so it won't be started on branches other than main
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
- name: Setup git user to "ThisDot Open-Source"
shell: bash
run: git config user.email "opensource@thisdot.co" && git config user.name "ThisDot Open-Source"
- name: Release a specific project
run: npx nx version ${{ github.event.inputs.target_project }} --releaseAs=${{ github.event.inputs.release_as }} --skipProjectChangelog=true --noVerify=true --preid=rc
- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx nx publish ${{ github.event.inputs.target_project }}
- name: Create Release pull-request
uses: peter-evans/create-pull-request@v4
with:
title: Release ${{ github.event.inputs.target_project }} as ${{ github.event.inputs.release_as }}
body: Release ${{ github.event.inputs.target_project }} as ${{ github.event.inputs.release_as }}
branch: release/${{ github.event.inputs.target_project }}
base: main
- name: Push tags to github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: git push --tags