Skip to content

Commit

Permalink
Single branch for development and release
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelpaul committed Nov 20, 2023
1 parent 07009b3 commit 42c958b
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: "Code scanning - action"

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ on:
push:
branches:
- main
paths:
- VERSION

jobs:
gh_release:
github:
permissions:
contents: write
uses: Adyen/release-automation-action/.github/workflows/reusable-github-release.yml@v1.0.0
uses: Adyen/release-automation-action/.github/workflows/reusable-github-release.yml@v1.1.1
with:
release-title: Adyen Go API Library
develop-branch: develop
release-branch: main
release-title: Adyen Go API Library
develop-branch: main
secrets:
token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }}
token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Go

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

jobs:
build:
Expand All @@ -20,7 +20,7 @@ jobs:
- name: Test
run: go test -v ./... -tags $GO_TEST_TAGS
env:
GO_TEST_TAGS: ${{ github.ref == 'refs/heads/main' && 'integration' || 'unit' }}
GO_TEST_TAGS: ${{ contains(github.event.pull_request.labels.*.name, 'release') && 'integration' || 'unit' }}
ADYEN_API_KEY: ${{ secrets.ADYEN_API_KEY }}
ADYEN_MERCHANT: ${{ secrets.ADYEN_MERCHANT }}
ADYEN_PASSWORD: ${{ secrets.ADYEN_PASSWORD }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }}
committer: ${{ secrets.ADYEN_AUTOMATION_BOT_EMAIL }}
author: ${{ secrets.ADYEN_AUTOMATION_BOT_EMAIL }}
base: develop
base: main
branch: automation/models
title: ${{ steps.vars.outputs.pr_title }}
body: ${{ steps.vars.outputs.pr_body }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,25 @@ on:
type: boolean
default: false
description: "This release will be labeled as non-production ready"
push:
pull_request:
types:
- closed
branches:
- develop
- main

jobs:
release:
candidate:
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged && !startsWith(github.head_ref, 'promote/'))
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare the next main release
uses: Adyen/release-automation-action@v1.0.0
uses: Adyen/release-automation-action@v1.1.1
with:
token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }}
develop-branch: develop
release-branch: main
develop-branch: main
version-files: src/common/configuration.go
pre-release: ${{ inputs.pre-release || false }}
pre-release: ${{ inputs.pre-release || false }}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## How to contribute step-by-step

1. Fork the `Adyen/adyen-go-api-library` repository.
2. Create a new branch from `develop` in your fork. This makes it easier for you to keep track of your changes.
2. Create a new branch from `main` in your fork. This makes it easier for you to keep track of your changes.
3. Make the desired changes to the code.
* If you are adding new functionality or fixing a bug, we recommend you add unit tests that cover it.
4. Push the changes to your fork.
Expand Down
6 changes: 3 additions & 3 deletions RELEASE_PROCESS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Steps for Release of this library

Releases are done on GitHub on the `main` branch. All development is done on the `develop` branch only.
Development and releases happen on GitHub from the `main` branch.

**Step 0**: Update the exact API version to be supported (ie `CheckoutAPIVersion = v69`) in `src/adyen/api.go`

Expand All @@ -14,6 +14,6 @@ Releases are done on GitHub on the `main` branch. All development is done on the

**Step 5**: Find and replace `github.com/adyen/adyen-go-api-library/v<current major version>` with `github.com/adyen/adyen-go-api-library/v<new major version>` throughout the project including test files and README. For example `github.com/adyen/adyen-go-api-library/v3` will become `github.com/adyen/adyen-go-api-library/v4`

**Step 6**: create a PR form `develop` to `main` and wait for all tests to pass and for approvals
**Step 6**: Review the automatic release PR

**Step 7**: once ready merge the PR to main and create a GitHub release with changelog and a new tag corresponding to the version
**Step 7**: Review the generated Github release and its release notes

0 comments on commit 42c958b

Please sign in to comment.