Skip to content

Commit 96204b3

Browse files
authored
Merge pull request #28 from Team-MostWanted/bugfix/INFRA-2359-fix-filename
Bugfix/infra 2359 fix filename
2 parents c775791 + 0512c62 commit 96204b3

File tree

5 files changed

+82
-19
lines changed

5 files changed

+82
-19
lines changed

.github/workflows/actions.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ jobs:
1111

1212
steps:
1313
- name: Set up Go
14-
uses: actions/setup-go@v3
14+
uses: actions/setup-go@v4
1515
with:
16-
go-version: 1.21
16+
go-version: 'stable'
1717

1818
- name: checkout repo
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
2020

2121
- name: read version file
2222
id: getversion
23-
run: echo "::set-output name=version::$(make version)"
23+
run: echo "version=$(make version)" >> $GITHUB_OUTPUT
2424

2525
- name: Build tar files
2626
run: make dist

.github/workflows/auto-update.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Security Updates Workflow
2+
3+
on:
4+
schedule:
5+
- cron: '0 12 1-7 1,4,7,10 1' # first monday every January, April, July and October
6+
7+
jobs:
8+
security_updates:
9+
name: Run dependency updates and create PR
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Determine current year and quarter
17+
id: vars
18+
run: |
19+
YEAR=$(date +%Y)
20+
QUARTER=$(( ($(date +%-m)-1)/3+1 ))
21+
22+
echo "year=$YEAR" >> $GITHUB_OUTPUT
23+
echo "quarter=$QUARTER" >> $GITHUB_OUTPUT
24+
echo "year_quarter=${YEAR}Q${QUARTER}" >> $GITHUB_OUTPUT
25+
26+
- name: Execute make update
27+
run: make update
28+
29+
- name: Create Pull Request
30+
uses: peter-evans/create-pull-request@v5
31+
with:
32+
token: ${{ secrets.GITHUB_TOKEN }}
33+
commit-message: "Update dependencies for ${{ steps.vars.outputs.year_quarter }}"
34+
title: "Security Updates ${{ steps.vars.outputs.year_quarter }}"
35+
body: "Automated pull request created by GitHub Actions."
36+
branch: "feature/security-updates-${{ steps.vars.outputs.year_quarter }}"
37+
delete-branch: true
38+
reviewers: |
39+
rtuk
40+
TheM1984
41+
Lveltmaat
42+
draft: false

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) with the minor change that we use a prefix instead of grouping.
55
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1.10.0] - 2024-01-10
8+
- Security: updated the dependencies in Github actions
9+
- Added: Github action to have an automatically dependency check
10+
- Fixed: make dist-check was skipped because of missing branch variable
11+
- Fixed: added filename with the build folder
12+
- Changed: moved away from deprecated Github actions
13+
714
## [1.9.0] - 2024-01-09
815
- Changed: updated makefile to a more generic one
916
- Fixed: minor issues stated from the new make update, eg replaced deprecated ioutils

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@ build:
6464
for target in $(TARGETS); do \
6565
os=$$(echo $$target | cut -d/ -f1); \
6666
arch=$$(echo $$target | cut -d/ -f2); \
67-
GOOS=$$os GOARCH=$$arch $(GO) build $(GO_LDFLAGS) -o $(BUILD_DIR)/$(VERSION)-$$os-$$arch/ $(PACKAGES); \
67+
GOOS=$$os GOARCH=$$arch $(GO) build $(GO_LDFLAGS) -o $(BUILD_DIR)/$(APPNAME)-$(VERSION)-$$os-$$arch/ $(PACKAGES); \
6868
done; \
6969
else \
7070
echo "No building required, module does not contain the 'main' package."; \
7171
fi
7272

7373
.PHONY: dist-check
7474
dist-check:
75-
ifneq (,$(filter $(bamboo_planRepository_branchName),release/acceptance master))
76-
@echo "Performing dist check for: $(bamboo_planRepository_branchName)"
75+
ifneq (,$(filter ${GITHUB_REF\#refs/heads/},release/acceptance master))
76+
@echo "Performing dist check for: ${GITHUB_REF\#refs/heads/}"
7777

7878
@if ! test -z "$$(sed -E -n '/(upcoming|unreleased)/I,/##/p' changelog.md | sed '1d;$$d' | sed 's/[[:space:]-]//g')"; then \
7979
echo "Error: cannot generate dist, changelog.md must not contain unreleased lines."; \
@@ -104,7 +104,7 @@ dist-create:
104104
for target in $(TARGETS); do \
105105
os=$$(echo $$target | cut -d/ -f1); \
106106
arch=$$(echo $$target | cut -d/ -f2); \
107-
tar -C $(BUILD_DIR) -cvzf $(DIST_DIR)/$(APPNAME)-$(VERSION)-$$os-$$arch.tar.gz $(VERSION)-$$os-$$arch; \
107+
tar -C $(BUILD_DIR) -cvzf $(DIST_DIR)/$(APPNAME)-$(VERSION)-$$os-$$arch.tar.gz $(APPNAME)-$(VERSION)-$$os-$$arch; \
108108
done; \
109109
fi
110110

README.md

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ If you want to contribute to this project please follow these guidelines:
272272
- Changes should be reflected into the [CHANGELOG.md](CHANGELOG.md)
273273

274274
The maintainers
275-
- Bump the [VERSION](VERSION) file if a release is needed
275+
- Version is derived from the [CHANGELOG.md](CHANGELOG.md) using the last non-upcoming header (##)
276+
- Use `make update` to automatically update dependencies and add a line in the [CHANGELOG.md](CHANGELOG.md)
276277

277278
### Building
278279

@@ -286,16 +287,29 @@ make
286287

287288
This creates a binary in the `./build` folder. Look at the [Build options section](#Build%20options) for more build options.
288289

289-
#### Build options
290-
291-
target | description
292-
--------|------------
293-
all | execute `test` and `build` target
294-
build | use `go build` to create binary for current GOARCH and GOOS in `./build`
295-
test | use `go test` to execute the unit test and create a coverage report `./build/test-coverage.out`
296-
clean | clean the build directory
297-
compile | build the script for FreeBDS, Linux, MacOS, and Windows in `./build`
298-
dist | execute `clean` and `compile` targets, and create tar.gz files in `./dist`
290+
#### Make options
291+
292+
The targets used by default are:
293+
- freebsd/amd64
294+
- darwin/amd64
295+
- darwin/arm64
296+
- linux/amd64
297+
- linux/arm64
298+
- windows/amd64
299+
300+
Use `make <command> TARGETS=<os>/<arch>` to execute make with your own OS and Architecture, e.g. `make build TARGETS=freebsd/arm64`.
301+
302+
target | description
303+
------------|------------
304+
version | retrieve and display the version from the [CHANGELOG.md](CHANGELOG.md)
305+
test | use `go test` to execute the unit test and create a coverage report `./build/test-coverage.out`
306+
build | build the binary for every OS and Arch stated
307+
dist-check | validations performed to see if the codebase is ready for a release, on default this will skipped unless performed on the acceptance or master branch
308+
dist-create | create tar.gz files in `./dist` for all targets using the binaries from `./build`
309+
dist | perform a clean, dist-check build and dist-create
310+
update-dependencies | update go version and update dependencies, makes sure everything is tiday, and add a line to the changelog
311+
update | perform a clean, update-dependencies and a test
312+
clean | clean the build and dist directories
299313

300314
### TODO
301315

0 commit comments

Comments
 (0)