-
Notifications
You must be signed in to change notification settings - Fork 120
39 lines (37 loc) · 1.4 KB
/
publish.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
name: Publish Release Drafts
on:
workflow_dispatch:
inputs:
owner_repo_ids:
description: |
owner_repo_ids: JSON array of { owner: string, repo: string, release_id: number } objects.
All the listed release drafts will be published.
required: true
jobs:
publish:
name: Publish release drafts
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v3
with:
github-token: ${{ secrets.MOVE2KUBE_PATOKEN }}
script: |
const owner_repo_ids = JSON.parse('${{ github.event.inputs.owner_repo_ids }}');
const resp = await github.repos.getRelease(owner_repo_ids[0]);
const tag = resp.data.tag_name;
const promises = owner_repo_ids.map(owner_repo_id => github.repos.updateRelease({...owner_repo_id, draft: false}));
await Promise.all(promises);
await github.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: 'move2kube-website',
workflow_id: 'releaseinfo.yml',
ref: 'main',
inputs: {tag},
});
await github.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: 'move2kube-ui',
workflow_id: 'raise-operator-pr.yml',
ref: 'main',
inputs: {tag, 'commit_ref': 'main'},
});