forked from feast-dev/feast
-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (96 loc) · 3.71 KB
/
release.yml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: release
on:
workflow_dispatch:
inputs:
dry_run:
description: 'Dry Run'
required: true
default: true
type: boolean
token:
description: 'Personal Access Token'
required: true
default: ""
type: string
jobs:
get_dry_release_versions:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ github.event.inputs.token }}
outputs:
current_version: ${{ steps.get_versions.outputs.current_version }}
next_version: ${{ steps.get_versions.outputs.next_version }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Release (Dry Run)
id: get_versions
run: |
CURRENT_VERSION=$(npx -p @semantic-release/changelog -p @semantic-release/git -p @semantic-release/exec -p semantic-release semantic-release --dry-run | grep "associated with version " | sed -E 's/.* version//' | sed -E 's/ on.*//')
NEXT_VERSION=$(npx -p @semantic-release/changelog -p @semantic-release/git -p @semantic-release/exec -p semantic-release semantic-release --dry-run | grep 'The next release version is' | sed -E 's/.* ([[:digit:].]+)$/\1/')
echo ::set-output name=current_version::$CURRENT_VERSION
echo ::set-output name=next_version::$NEXT_VERSION
echo "Current version is ${CURRENT_VERSION}"
echo "Next version is ${NEXT_VERSION}"
# publish-web-ui-npm:
# if: github.repository == 'feast-dev/feast'
# needs: get_dry_release_versions
# runs-on: ubuntu-latest
# env:
# # This publish is working using an NPM automation token to bypass 2FA
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# CURRENT_VERSION: ${{ needs.get_dry_release_versions.outputs.current_version }}
# NEXT_VERSION: ${{ needs.get_dry_release_versions.outputs.next_version }}
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v2
# with:
# node-version: '17.x'
# registry-url: 'https://registry.npmjs.org'
# - name: Bump file versions (temporarily for Web UI publish)
# run: python ./infra/scripts/release/bump_file_versions.py ${CURRENT_VERSION} ${NEXT_VERSION}
# - name: Install yarn dependencies
# working-directory: ./ui
# run: yarn install
# - name: Build yarn rollup
# working-directory: ./ui
# run: yarn build:lib
# - name: Publish UI package
# working-directory: ./ui
# run: npm publish
# env:
# # This publish is working using an NPM automation token to bypass 2FA
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
release:
name: release
runs-on: ubuntu-latest
#needs: publish-web-ui-npm
env:
GITHUB_TOKEN: ${{ github.event.inputs.token }}
GIT_AUTHOR_NAME: feast-ci-bot
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: feast-ci-bot
GIT_COMMITTER_EMAIL: [email protected]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Release (Dry Run)
if: github.event.inputs.dry_run == 'true'
run: |
npx -p @semantic-release/changelog -p @semantic-release/git -p @semantic-release/exec -p semantic-release semantic-release --dry-run
- name: Release
if: github.event.inputs.dry_run == 'false'
run: |
npx -p @semantic-release/changelog -p @semantic-release/git -p @semantic-release/exec -p semantic-release semantic-release