-
Notifications
You must be signed in to change notification settings - Fork 455
92 lines (87 loc) · 2.93 KB
/
release.yaml
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
name: Release
on:
milestone:
types: [closed]
workflow_dispatch: {}
permissions:
id-token: write
contents: write
issues: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
submodules: recursive
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Get kubectl version
run: |
source hack/lib/kubectl-version.sh
echo "Using kubectl ${KUBECTL_VERSION}"
echo "KUBECTL_VERSION=$KUBECTL_VERSION" >> $GITHUB_ENV
- uses: azure/setup-kubectl@v4
with:
version: "${{ env.KUBECTL_VERSION }}"
id: install
- name: Get AWS credentials
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
role-duration-seconds: 900
aws-region: ${{ secrets.AWS_REGION }}
role-session-name: GithubActionsSession-publish
- name: Release Notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MILESTONE_NUMBER: "${{ github.event.milestone.number }}"
run: |
yarn install
yarn workspace releaser run exec
bash hack/build-ide-cfn.sh /tmp/ide-cfn.yaml
MILESTONE_TITLE=$(gh api "repos/$GITHUB_REPOSITORY/milestones/$MILESTONE_NUMBER" --jq '.title')
echo "MILESTONE_TITLE=$MILESTONE_TITLE" >> $GITHUB_ENV
- name: Set Git config
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Update stable branch
run: |
git checkout stable
git pull
git merge --no-ff main -m "Publish to stable"
git push
- name: Run publish (stable)
env:
CONTENT_BUCKET: "${{ secrets.CONTENT_BUCKET }}"
CONTENT_CLOUDFRONT: "${{ secrets.CONTENT_CLOUDFRONT }}"
BRANCH: stable
run: |
bash hack/publish-content.sh
- name: Create snapshot
run: |
suffix=$(git rev-parse --short HEAD)
snapshot_branch="snapshot-${suffix}"
git checkout -b "${snapshot_branch}"
git push origin "${snapshot_branch}"
echo "SNAPSHOT_BRANCH=$snapshot_branch" >> $GITHUB_ENV
- name: Run publish (snapshot)
env:
SNAPSHOT_BUCKET: "${{ secrets.SNAPSHOT_BUCKET }}"
SNAPSHOT_CLOUDFRONT: "${{ secrets.SNAPSHOT_CLOUDFRONT }}"
BRANCH: ${{ env.SNAPSHOT_BRANCH }}
run: |
bash hack/publish-snapshot.sh
- name: Create GitHub release
uses: ncipollo/release-action@v1
with:
tag: release-${{ env.SNAPSHOT_BRANCH }}
name: ${{ env.MILESTONE_TITLE }}
bodyFile: /tmp/release-notes.md
artifacts: "/tmp/ide-cfn.yaml"