-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (59 loc) · 2.38 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
name: Create Release on QA to Master Merge
on:
pull_request:
branches:
- main
- master
types:
- closed
jobs:
create_release:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Read version from package.json
id: get_version
run: echo "VERSION=$(jq -r '.version' package.json)" >> "$GITHUB_OUTPUT"
- name: Read module name
id: get_name
run: echo "MODULE_NAME=$(jq -r '.name' package.json)" >> "$GITHUB_OUTPUT"
- name: Extract commit message
id: extract_commit_message
run: echo "MESSAGE=$(git log --format=%B -n 1 ${{ github.event.pull_request.head.sha }})" >> "$GITHUB_OUTPUT"
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: Release_${{ steps.get_version.outputs.VERSION }}
# release_name: Release ${{ steps.get_version.outputs.VERSION }}
# body: ${{ steps.extract_commit_message.outputs.MESSAGE }}
# draft: false
# prerelease: false
- name: Module Information
uses: fjogeleit/http-request-action@v1
id: module_info
with:
url: 'https://market-api.rocketbot.com/modules/${{ steps.get_name.outputs.MODULE_NAME }}'
method: 'POST'
- name: Print Response
run: echo "${{ fromJson(steps.module_info.outputs.response).data.id }}"
# - name: Save Response
# id: save_response
# run: echo "MODULES=${{ fromJson(steps.module_info.outputs.response).data }}" >> "$GITHUB_OUTPUT"
# - name: Search in Modules
# id: search_in_modules
# run: |
# MODULE_NAME="${{ steps.get_name.outputs.MODULE_NAME }}"
# MODULE_ID=$(echo '${{ steps.save_response.outputs.MODULES }}' | jq -r --arg MODULE_NAME "$MODULE_NAME" '.[] | select(.name == $MODULE_NAME) | .id')
# echo "MODULE_ID=$MODULE_ID" >> "$GITHUB_OUTPUT"
# shell: bash
# - name: Update module in Market
# uses: fjogeleit/http-request-action@v1
# id: update_module
# with:
# url: 'https://market-api.rocketbot.com/modules/update/${{ steps.search_in_modules.outputs.MODULE_ID }}'
# method: 'POST'