Skip to content

Commit

Permalink
Merge pull request #220 from Adyen/ITT-534
Browse files Browse the repository at this point in the history
ITT-534: Release automation
  • Loading branch information
michaelpaul authored Jul 21, 2023
2 parents eee419a + 037e538 commit f652898
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 28 deletions.
17 changes: 5 additions & 12 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: "Code scanning - action"

on:
push:
branches: [develop]
pull_request:
branches: [develop]
schedule:
- cron: '0 6 * * 6'

Expand All @@ -14,22 +16,13 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}


# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java
with:
languages: go

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/gh_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Github Release

on:
workflow_dispatch:
push:
branches:
- main

jobs:
gh_release:
permissions:
contents: write
uses: Adyen/adyen-dotnet-api-library/.github/workflows/lib-gh-release.yml@develop
with:
project-name: Go
secrets: inherit
15 changes: 4 additions & 11 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,23 @@
name: Go

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

jobs:

build:
name: Build & Verify
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.13
uses: actions/setup-go@v4
- uses: actions/checkout@v3

- uses: actions/setup-go@v4
with:
go-version: 1.13
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Get dependencies
run: |
go get -v -t -d ./...
run: go get -v -t -d ./...

- name: Build
run: go build -v .
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ jobs:
runs-on: ubuntu-latest
name: Generate Models
steps:
- name: Set up Go
uses: actions/setup-go@v4
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: 1.18
id: go
- uses: actions/checkout@v3
- run: make models
- name: Set PR variables
id: vars
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/release_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Release request

on:
workflow_dispatch:
push:
branches:
- develop

jobs:
release:
permissions:
contents: write
pull-requests: write
uses: Adyen/adyen-dotnet-api-library/.github/workflows/lib-release.yml@develop
secrets: inherit
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,12 @@ clean:
git checkout src
git clean -f -d src

## Releases

.PHONY: templates models $(services)
version:
perl -lne 'print "currentVersion=$$1" if /LibVersion = "(.+)"/' < src/common/configuration.go >> "$$GITHUB_OUTPUT"

bump:
perl -i -pe 's/$$ENV{"CURRENT_VERSION"}/$$ENV{"NEXT_VERSION"}/' src/common/configuration.go

.PHONY: templates models $(services) version bump

0 comments on commit f652898

Please sign in to comment.