Skip to content

Commit 937e6f0

Browse files
authored
Updating workflows (#649)
1 parent f4a0a9e commit 937e6f0

36 files changed

+218
-440
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ updates:
1818
schedule:
1919
interval: "weekly"
2020
- package-ecosystem: "gomod" # See documentation for possible values
21-
directory: "/bdgz" # Location of package manifests
21+
directory: "/bitdefender" # Location of package manifests
2222
schedule:
2323
interval: "weekly"

.github/workflows/README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,28 @@
66
***hotfix/\*\*/\*\****<br>
77

88
## Feature:
9-
__Note__: only one feature per version
10-
1. Create branch from main for the feature
9+
__Note__: only one feature per version.
10+
1. Create branch from main for the feature.
1111
2. Every developer related to the feature works on this branch.
12-
3. When they finish they push
13-
4. This push activates the dev actions, generates the dev images, and is automatically deployed to dev environment
14-
5. When everything is tested, PR is made to main
15-
6. After this PR is approved, the rc actions are activated, and the rc images are generated
16-
7. RC is updated manually to see that everything works well and we test it in RC
17-
11. If everything works well, merge to main and create a tag and said tag activates release actions
12+
3. When they finish they push.
13+
4. This push activates the DEV actions, generates the DEV images, and is automatically deployed to DEV environment.
14+
5. When everything is tested, PR is made to main.
15+
6. After this PR is approved, the QA actions are activated, and the QA images are generated.
16+
7. QA is updated manually to see that everything works well.
17+
11. If everything works well, merge to main activate RC actions and generate RC images.
18+
12. After test on RC, create a new release that will activate release actions.
1819

1920
## Hotfix
20-
1. Create branch from main for the hotfix
21+
1. Create branch from main for the hotfix.
2122
2. Every developer related to the hotfix works on this branch.
22-
3. When they finish , they make a PR to main
23-
4. After this PR is approved, the rc actions are activated, and the rc images are generated
24-
5. RC is updated manually to see that everything works well and we test it in RC
25-
6. If everything works well, merge to main and create a tag and said tag activates release actions
23+
3. When they finish, they make a PR to main.
24+
4. After this PR is merged to main, the rc actions are activated, and the rc images are generated.
25+
5. RC is updated manually to see that everything works well and we test it in RC.
26+
6. If everything works well, create a new release that will activate release actions.
2627

2728

2829
### Actions
2930
dev->on push ***feature/\*\*/\*\**** branch<br>
30-
rc->on pull-request: approved main branch<br>
31-
release-> on tag v*<br>
31+
qa->on pull-request: approved main branch<br>
32+
rc->on push: main branch<br>
33+
release-> on release<br>

.github/workflows/principal-agent.yml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,47 @@
11
name: Agent Build
2+
23
on:
4+
release:
5+
types: [ 'released' ]
36
push:
4-
tags: [ 'v*' ]
5-
branches: [ 'feature/**' ]
7+
branches: [ 'main', 'feature/**' ]
8+
paths:
9+
- 'agent/**'
10+
- 'version.yml'
611
pull_request_review:
712
types: [submitted]
13+
paths:
14+
- 'agent/**'
15+
- 'version.yml'
816

917
jobs:
1018
check:
1119
name: Checking
1220
runs-on: ubuntu-latest
1321
outputs:
1422
env_version: ${{ steps.set-env.outputs.env_version }}
15-
agent_checking: ${{ steps.changes_agent_output.outputs.agent_checking }}
1623
steps:
1724
- name: Determine Build Environment
1825
id: set-env
1926
run: |
2027
if ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/feature/') }}; then
2128
echo "DEV environment"
2229
echo "env_version=v10-dev" >> $GITHUB_OUTPUT
23-
elif ${{ github.event_name == 'pull_request_review' && github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'main' }}; then
30+
elif ${{ github.event_name == 'pull_request_review' && github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'main' && startsWith(github.event.pull_request.head.ref, 'feature/') }}; then
31+
echo "QA environment"
32+
echo "env_version=v10-qa" >> $GITHUB_OUTPUT
33+
elif ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}; then
2434
echo "RC environment"
2535
echo "env_version=v10-rc" >> $GITHUB_OUTPUT
26-
elif ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}; then
36+
elif ${{ github.event_name == 'release' }}; then
2737
echo "RELEASE environment"
2838
echo "env_version=release" >> $GITHUB_OUTPUT
2939
fi
30-
- uses: actions/checkout@v2
31-
- uses: dorny/paths-filter@v2
32-
id: changes_agent
33-
with:
34-
filters: |
35-
paths:
36-
- 'agent/**'
37-
- 'version.yml'
38-
- id: changes_agent_output
39-
run: |
40-
echo "agent_checking=${{ steps.changes_agent.outputs.paths }}" >> $GITHUB_OUTPUT
4140
4241
build:
4342
name: Build
4443
needs: check
45-
if: needs.check.outputs.agent_checking == 'true'
44+
if: needs.check.outputs.env_version != ''
4645
runs-on: signing
4746
steps:
4847
- name: Checkout code

.github/workflows/principal-dev-rc.yml

Lines changed: 0 additions & 243 deletions
This file was deleted.

.github/workflows/principal-installer-dev.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Installer Dev
22

33
on:
44
workflow_run:
5-
workflows: ["Dev/Rc Deploy"]
5+
workflows: ["Multi Environment Build"]
66
types:
77
- completed
88

@@ -15,8 +15,8 @@ jobs:
1515
steps:
1616
- id: check
1717
run: |
18-
echo ${{ github.event.workflow_run.event }}
19-
if ${{ startsWith(github.event.workflow_run.head_branch, 'feature/') && github.event.workflow_run.event != 'pull_request_review'}}; then
18+
echo "Doing ${{ github.event.workflow_run.event }} on ${{ github.event.workflow_run.head_branch }}"
19+
if ${{ github.event.workflow_run.event == 'push' && startsWith(github.event.workflow_run.head_branch, 'feature/') }}; then
2020
echo "It's a feature"
2121
echo "is_feature=true" >> $GITHUB_OUTPUT
2222
else
@@ -31,6 +31,8 @@ jobs:
3131
steps:
3232
- name: Check out code into the right branch
3333
uses: actions/checkout@v4
34+
with:
35+
ref: ${{ github.event.workflow_run.head_branch }}
3436

3537
- name: Set up Go 1.x
3638
uses: actions/setup-go@v4

0 commit comments

Comments
 (0)