-
Notifications
You must be signed in to change notification settings - Fork 3
61 lines (56 loc) · 1.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
name: Release
on:
workflow_dispatch:
push:
branches:
- main
paths:
- '**/*.tpl'
- '**/*.py'
- '**/*.tf'
- '.github/workflows/release.yml'
jobs:
release:
name: Release
runs-on: [self-hosted, production]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- name: setup node 16
uses: actions/setup-node@v3
with:
node-version: 16
- name: Release
uses: cycjimmy/semantic-release-action@v2
id: semantic
with:
semantic_version: 18.0.0
extra_plugins: |
@semantic-release/[email protected]
@semantic-release/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
- name: Set env current release
run: echo "RELEASE_VERSION=${{ steps.semantic.outputs.last_release_version }}" >> $GITHUB_ENV
- name: Set env new release if exist
if: steps.semantic.outputs.new_release_published == 'true'
run: echo "RELEASE_VERSION=${{ steps.semantic.outputs.new_release_version }}" >> $GITHUB_ENV
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Save release in mongo
run: |
python -m venv test
source ./test/bin/activate
pip install -r requirements.txt
export PYTHONPATH="${PYTHONPATH}:${PWD}"
python post_release.py
deactivate
env:
PROD_MONGO_URI: ${{ secrets.PROD_MONGO_URI }}
TAG: ${{ env.RELEASE_VERSION }}