Skip to content

Commit

Permalink
chore: rename master -> main in CI and scripts (mapbox#246)
Browse files Browse the repository at this point in the history
Thanks for contributing to FOSS4G!
  • Loading branch information
atierian authored Mar 7, 2022
1 parent e1cd6f8 commit ea234ed
Show file tree
Hide file tree
Showing 28 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android-ci-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
pull_request:
branches:
- master
- main
paths-ignore:
- "platform/ios/**"
- "platform/qt/**"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- ".gitignore"
pull_request:
branches:
- master
- main
paths-ignore:
- "platform/android/**"
- "platform/qt/**"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/macos-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ on:
- "README.md"
- ".gitignore"
branches:
- master
- main
pull_request:
branches:
- master
- main
paths-ignore:
- "platform/android/**"
- "platform/qt/**"
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ on:
- "platform/qt/**"
- ".gitignore"
branches:
- master
- main
pull_request:
branches:
- master
- main
paths-ignore:
- "platform/android/**"
- "platform/ios/**"
Expand All @@ -31,7 +31,7 @@ jobs:
- ubuntu-18.04
runs-on: ${{ matrix.os }}
env:
BUILDTYPE: ${{github.ref == 'refs/heads/master' && 'Release' || 'Debug'}}
BUILDTYPE: ${{github.ref == 'refs/heads/main' && 'Release' || 'Debug'}}

defaults:
run:
Expand Down Expand Up @@ -127,13 +127,13 @@ jobs:

# On PRs make sure that the npm package can be packaged.
- name: Pack
if: github.ref != 'refs/heads/master'
if: github.ref != 'refs/heads/main'
run: |
npm pack --dry-run
# Uncomment to start publishing the package
# @TODO: Figure out the binary distribution method.
# - name: Publish package
# if: github.ref == 'refs/heads/master'
# if: github.ref == 'refs/heads/main'
# run: |
# npm publish
2 changes: 1 addition & 1 deletion .github/workflows/qt-ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
- ".gitignore"
pull_request:
branches:
- master
- main
paths-ignore:
- "platform/android/**"
- "platform/darwin/**"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qt-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
- ".gitignore"
pull_request:
branches:
- master
- main
paths-ignore:
- "platform/android/**"
- "platform/darwin/**"
Expand Down
2 changes: 1 addition & 1 deletion platform/android/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export BUILDTYPE ?= Debug
export IS_LOCAL_DEVELOPMENT ?= true
export TARGET_BRANCH ?= master
export TARGET_BRANCH ?= main

CMAKE ?= cmake

Expand Down
2 changes: 1 addition & 1 deletion platform/android/scripts/metrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ scripts/check_binary_size.js "MapboxGLAndroidSDK/build/intermediates/intermediat
# Track overall library size
scripts/check_binary_size.js "MapboxGLAndroidSDK/build/outputs/aar/MapboxGLAndroidSDK-release.aar" "Android AAR"

if [[ $CIRCLE_BRANCH == master ]]; then
if [[ $CIRCLE_BRANCH == main ]]; then
# Build source data for http://mapbox.github.io/mapbox-gl-native/metrics/binary-size/
# and log binary sizes to metrics warehouse
scripts/publish_binary_size.js
Expand Down
2 changes: 1 addition & 1 deletion platform/android/scripts/release-notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const bestReleaseNotesForCurrentVersion = semver.minSatisfying(versionsInRelease
const currentReleaseNotes = _.find(releaseNotes, { version: bestReleaseNotesForCurrentVersion });

if (!currentReleaseNotes) {
console.error('Could not find a release section satisfying %s in %s — did you forget to rename the "master" section to %s?', currentVersion, changelogPath, currentVersion.split("-")[0]);
console.error('Could not find a release section satisfying %s in %s — did you forget to rename the "main" section to %s?', currentVersion, changelogPath, currentVersion.split("-")[0]);
process.exit(1);
}

Expand Down
18 changes: 9 additions & 9 deletions platform/android/scripts/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@
Examples:
- Publish a snapshot from master (release.py uses the current branch)
- Publish a snapshot from main (release.py uses the current branch)
$ git branch
* master
* main
1234-fix-crash
$ python release.py --stage snapshot
- Publish a snapshot from a feature branch (same as before, just switch branchs with git):
$ git branch
master
main
* 1234-fix-crash
$ python release.py --stage snapshot
- Publish a beta from a pre-release branch:
$ git branch
master
main
* release-android-420-beta1
$ python release.py --stage beta --version 4.2.0-beta.1
- Publish a beta from a release branch:
$ git branch
master
main
* release-android-420
$ python release.py --stage final --version 4.2.0
Expand Down Expand Up @@ -97,13 +97,13 @@ def validate_branch(stage):
branch = git_get_current_branch()
if not branch:
abort_with_message('The current folder is not a git repository.')
if branch == 'master' and stage != 'snapshot':
if branch == 'main' and stage != 'snapshot':
abort_with_message('You need to swtich to a release branch for a beta or a final release.')
return branch

def validate_version(stage, branch, version):
if stage == 'snapshot' and branch == 'master' and version != CURRENT_VERSION_TAG:
abort_with_message('You cannot specify a custom version if you are building a snapshot from master.')
if stage == 'snapshot' and branch == 'main' and version != CURRENT_VERSION_TAG:
abort_with_message('You cannot specify a custom version if you are building a snapshot from main.')

if not version or version == CURRENT_VERSION_TAG:
version = get_current_version(file_path=GRADLE_PROPERTIES_PATH, file_var=GRADLE_TOKEN)
Expand All @@ -122,7 +122,7 @@ def validate_version(stage, branch, version):

def publish_snapshot(branch, version):
click.echo('Publishing snapshot for branch: %s (version: %s).' % (branch, version))
if branch != 'master':
if branch != 'main':
dirty_gradle = update_current_version(file_path=GRADLE_PROPERTIES_PATH, file_var=GRADLE_TOKEN, version=version)
if dirty_gradle:
git_add(path=GRADLE_PROPERTIES_PATH)
Expand Down
2 changes: 1 addition & 1 deletion platform/ios/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export BUILDTYPE ?= Debug
export IS_LOCAL_DEVELOPMENT ?= true
export TARGET_BRANCH ?= master
export TARGET_BRANCH ?= main
export CI ?= 0

CMAKE ?= cmake
Expand Down
2 changes: 1 addition & 1 deletion platform/ios/platform/ios/scripts/metrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ scripts/check_binary_size.js "build/ios/pkg/dynamic/Mapbox-stripped-x86_64" "iO
# Track overall library size
scripts/check_binary_size.js "build/ios/pkg/dynamic/Mapbox-stripped" "iOS Dynamic"

if [[ $CIRCLE_BRANCH == master ]]; then
if [[ $CIRCLE_BRANCH == main ]]; then
# Build source data for http://mapbox.github.io/mapbox-gl-native/metrics/binary-size/
# and log binary sizes to metrics warehouse
scripts/publish_binary_size.js
Expand Down
2 changes: 1 addition & 1 deletion platform/ios/platform/ios/scripts/release-notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const bestReleaseNotesForCurrentVersion = semver.minSatisfying(versionsInRelease
const currentReleaseNotes = _.find(releaseNotes, { version: bestReleaseNotesForCurrentVersion });

if (!currentReleaseNotes) {
console.error('Could not find a release section satisfying %s in %s — did you forget to rename the "master" section to %s?', currentVersion, changelogPath, currentVersion.split("-")[0]);
console.error('Could not find a release section satisfying %s in %s — did you forget to rename the "main" section to %s?', currentVersion, changelogPath, currentVersion.split("-")[0]);
process.exit(1);
}

Expand Down
2 changes: 1 addition & 1 deletion platform/ios/platform/macos/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog for Mapbox Maps SDK for macOS

MapLibre welcomes participation and contributions from everyone. Please read [`Contributing Guide`](https://github.com/maplibre/maplibre-gl-native/blob/master/CONTRIBUTING.md) to get started.
MapLibre welcomes participation and contributions from everyone. Please read [`Contributing Guide`](https://github.com/maplibre/maplibre-gl-native/blob/main/CONTRIBUTING.md) to get started.

## 0.19.1 - September 06, 2021

Expand Down
2 changes: 1 addition & 1 deletion platform/ios/platform/macos/scripts/release-notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const bestReleaseNotesForCurrentVersion = semver.minSatisfying(versionsInRelease
const currentReleaseNotes = _.find(releaseNotes, { version: bestReleaseNotesForCurrentVersion });

if (!currentReleaseNotes) {
console.error('Could not find a release section satisfying %s in %s — did you forget to rename the "master" section to %s?', currentVersion, changelogPath, currentVersion.split("-")[0]);
console.error('Could not find a release section satisfying %s in %s — did you forget to rename the "main" section to %s?', currentVersion, changelogPath, currentVersion.split("-")[0]);
process.exit(1);
}

Expand Down
2 changes: 1 addition & 1 deletion platform/ios/scripts/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (pr) {
} else {
const head = process.env['GITHUB_SHA'];
for (const sha of execSync(`git rev-list --max-count=500 ${head}`).toString().trim().split('\n')) {
const base = execSync(`git branch -r --contains ${sha} origin/master origin/release-*`).toString().split('\n')[0].trim().replace(/^origin\//, '');
const base = execSync(`git branch -r --contains ${sha} origin/main origin/release-*`).toString().split('\n')[0].trim().replace(/^origin\//, '');
if (base) {
const mergeBase = execSync(`git merge-base origin/${base} ${head}`).toString().trim();
console.log(`export GITHUB_TARGET_BRANCH=${base}`);
Expand Down
6 changes: 3 additions & 3 deletions platform/ios/scripts/nitpick/submodule-pin.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const child_process = require('child_process');
const head = child_process.execSync('git -C maplibre-gl-js rev-parse HEAD').toString().trim();
const revs = child_process.execSync(`git -C maplibre-gl-js branch -a --contains ${head}`).toString().split('\n');

if (revs.indexOf(' remotes/origin/master') >= 0) {
nitpick.ok(`maplibre-gl-js submodule pin is merged to master`);
if (revs.indexOf(' remotes/origin/main') >= 0) {
nitpick.ok(`maplibre-gl-js submodule pin is merged to main`);
} else {
nitpick.fail(`maplibre-gl-js submodule is pinned to ${head}, which isn't merged to master`);
nitpick.fail(`maplibre-gl-js submodule is pinned to ${head}, which isn't merged to main`);
}
2 changes: 1 addition & 1 deletion platform/ios/scripts/publish_binary_size.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function query(after) {
},
query: `query {
repository(owner: "mapbox", name: "mapbox-gl-native") {
ref(qualifiedName: "master") {
ref(qualifiedName: "main") {
target {
... on Commit {
history(first: 100, before: "36c6a8ea79bbd2596abb58ffb58debf65a4ea13d" ${after ? `, after: "${after}"` : ''}) {
Expand Down
2 changes: 1 addition & 1 deletion platform/ios/scripts/publish_doxygen_coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ github.apps.createInstallationToken({installation_id: SIZE_CHECK_APP_INSTALLATIO
}
})];

if (process.env['CIRCLE_BRANCH'] === 'master') {
if (process.env['CIRCLE_BRANCH'] === 'main') {
promises.push(new AWS.S3({region: 'us-east-1'}).putObject({
Body: zlib.gzipSync(JSON.stringify({
'created_at': date,
Expand Down
2 changes: 1 addition & 1 deletion platform/ios/scripts/update-boost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ popd

echo "If everything works, run:"
echo ""
echo " git -C vendor/boost checkout master"
echo " git -C vendor/boost checkout main"
echo " git -C vendor/boost commit -m \"update boost to ${VERSION/_/.}\""
echo " git -C vendor/boost push"
echo " git add vendor/boost"
Expand Down
2 changes: 1 addition & 1 deletion platform/linux/scripts/after_success.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e
set -o pipefail

if [ "${TRAVIS_PULL_REQUEST_BRANCH:-${TRAVIS_BRANCH}}" = "master" ] && [ "${BUILDTYPE}" = "Release" ]; then
if [ "${TRAVIS_PULL_REQUEST_BRANCH:-${TRAVIS_BRANCH}}" = "main" ] && [ "${BUILDTYPE}" = "Release" ]; then
CLOUDWATCH=true platform/linux/scripts/metrics.sh
else
echo "Not logging binary size for branch or Debug build"
Expand Down
4 changes: 2 additions & 2 deletions platform/node/DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ npm test

## Merging your pull request

To clean up your pull request and prepare it for merging, update your local `master` branch, then run `git rebase -i master` from your pull request branch to squash/fixup commits as needed. When your work is ready to be merged, you can run `git merge --ff-only YOUR_BRANCH` from `master` or click the green merge button in the GitHub UI, which will automatically squash your branch down into a single commit before merging it.
To clean up your pull request and prepare it for merging, update your local `main` branch, then run `git rebase -i main` from your pull request branch to squash/fixup commits as needed. When your work is ready to be merged, you can run `git merge --ff-only YOUR_BRANCH` from `main` or click the green merge button in the GitHub UI, which will automatically squash your branch down into a single commit before merging it.

## Publishing

Expand All @@ -112,4 +112,4 @@ If everything looks good:

### Preleases

Publishing a prerelease binary can be useful for testing downstream integrations - the workflow is pretty much the same except that you'll be making your version number commit and `git tag node-v{VERSION}` (like `git tag node-v3.3.2-pre.1`) on a pull request branch before merging it rather than on `master`.
Publishing a prerelease binary can be useful for testing downstream integrations - the workflow is pretty much the same except that you'll be making your version number commit and `git tag node-v{VERSION}` (like `git tag node-v3.3.2-pre.1`) on a pull request branch before merging it rather than on `main`.
2 changes: 1 addition & 1 deletion platform/node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ The `request()` method handles a request for a resource. The `ratio` sets the sc
}
```

The `kind` is an enum and defined in [`mbgl.Resource`](https://github.com/maplibre/maplibre-gl-native/blob/master/include/mbgl/storage/resource.hpp):
The `kind` is an enum and defined in [`mbgl.Resource`](https://github.com/maplibre/maplibre-gl-native/blob/main/include/mbgl/storage/resource.hpp):

```json
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (pr) {
} else {
const head = process.env['CIRCLE_SHA1'];
for (const sha of execSync(`git rev-list --max-count=500 ${head}`).toString().trim().split('\n')) {
const base = execSync(`git branch -r --contains ${sha} origin/master origin/release-*`).toString().split('\n')[0].trim().replace(/^origin\//, '');
const base = execSync(`git branch -r --contains ${sha} origin/main origin/release-*`).toString().split('\n')[0].trim().replace(/^origin\//, '');
if (base) {
const mergeBase = execSync(`git merge-base origin/${base} ${head}`).toString().trim();
console.log(`export CIRCLE_TARGET_BRANCH=${base}`);
Expand Down
6 changes: 3 additions & 3 deletions scripts/nitpick/submodule-pin.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const child_process = require('child_process');
const head = child_process.execSync('git -C maplibre-gl-js rev-parse HEAD').toString().trim();
const revs = child_process.execSync(`git -C maplibre-gl-js branch -a --contains ${head}`).toString().split('\n');

if (revs.indexOf(' remotes/origin/master') >= 0) {
nitpick.ok(`maplibre-gl-js submodule pin is merged to master`);
if (revs.indexOf(' remotes/origin/main') >= 0) {
nitpick.ok(`maplibre-gl-js submodule pin is merged to main`);
} else {
nitpick.fail(`maplibre-gl-js submodule is pinned to ${head}, which isn't merged to master`);
nitpick.fail(`maplibre-gl-js submodule is pinned to ${head}, which isn't merged to main`);
}
2 changes: 1 addition & 1 deletion scripts/publish_binary_size.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function query(after) {
},
query: `query {
repository(owner: "mapbox", name: "mapbox-gl-native") {
ref(qualifiedName: "master") {
ref(qualifiedName: "main") {
target {
... on Commit {
history(first: 100, before: "36c6a8ea79bbd2596abb58ffb58debf65a4ea13d" ${after ? `, after: "${after}"` : ''}) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/publish_doxygen_coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ github.apps.createInstallationToken({installation_id: SIZE_CHECK_APP_INSTALLATIO
}
})];

if (process.env['CIRCLE_BRANCH'] === 'master') {
if (process.env['CIRCLE_BRANCH'] === 'main') {
promises.push(new AWS.S3({region: 'us-east-1'}).putObject({
Body: zlib.gzipSync(JSON.stringify({
'created_at': date,
Expand Down
2 changes: 1 addition & 1 deletion scripts/update-boost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ popd

echo "If everything works, run:"
echo ""
echo " git -C vendor/boost checkout master"
echo " git -C vendor/boost checkout main"
echo " git -C vendor/boost commit -m \"update boost to ${VERSION/_/.}\""
echo " git -C vendor/boost push"
echo " git add vendor/boost"
Expand Down

0 comments on commit ea234ed

Please sign in to comment.