-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (69 loc) · 2.44 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
name: release
on:
# for testing
workflow_dispatch:
# for production
release:
types: [created]
env:
DEBUG_FLAG: ${{ true }}
# DEBUG_FLAG: ${{ false }}
RELEASE_PLATFORM_DIR: "release"
RELEASE_RUNNER_OUTPUT_DIR: "release/tmp"
RELEASE_OUTPUT_NAME: "platform-api-release"
jobs:
release:
runs-on: ubuntu-22.04
steps:
- name: Check Auth
if: github.event_name == 'workflow_dispatch' && github.actor != 'ricardojosegomezulmke' && github.actor != '195858'
run: |
echo "not authorized"
echo '::set-output name=IS_AUTHORIZED::false'
id: auth
- name: Cancel Workflow
if: ${{ always() && steps.auth.outputs.IS_AUTHORIZED == 'false' }}
uses: andymckay/cancel-action@0.2
- name: Checkout Current Branch
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: env before install
if: env.DEBUG_FLAG == 'true'
run: |
echo "bash --version: "; bash --version
echo "node --version: "; node --version
echo "npm --version: "; npm --version
echo ">>> environment: RELEASE_* "
env | grep RELEASE
- uses: actions/setup-node@v2
with:
node-version: '12.x'
registry-url: 'https://registry.npmjs.org'
- name: env after install
if: env.DEBUG_FLAG == 'true'
run: |
echo "bash --version: "; bash --version
echo "node --version: "; node --version
echo "npm --version: "; npm --version
echo "docker --version"; docker --version
echo "docker-compose --version"; docker-compose --version
- uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Release
run: |
export NODE_AUTH_TOKEN=${{ secrets.NPM_TOKEN }}
export APIM_SOLACE_PLATFORM_API_PROJECT_HOME="$GITHUB_WORKSPACE"
cd "$APIM_SOLACE_PLATFORM_API_PROJECT_HOME/${RELEASE_PLATFORM_DIR}"
./release.sh
- name: Archive logs
if: ${{ (failure() && !cancelled()) || (always() && (github.event_name=='workflow_dispatch' || env.DEBUG_FLAG=='true') ) }}
uses: actions/upload-artifact@v2
with:
name: ${{ env.RELEASE_OUTPUT_NAME }}
path: ${{ github.workspace }}/${{ env.RELEASE_RUNNER_OUTPUT_DIR }}
if-no-files-found: error
###
# The End.