mirror of
https://github.com/status-im/actions-gh-pages.git
synced 2025-02-23 10:18:23 +00:00
chore: change default branch from master to main (#396)
This commit is contained in:
parent
c935046a93
commit
932df18147
2
.github/workflows/codeql.yml
vendored
2
.github/workflows/codeql.yml
vendored
@ -3,7 +3,7 @@ name: "Code Scanning"
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
4
.github/workflows/dev-image.yml
vendored
4
.github/workflows/dev-image.yml
vendored
@ -3,7 +3,7 @@ name: 'Dev Image CI'
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
paths:
|
paths:
|
||||||
- '.github/workflows/dev-image.yml'
|
- '.github/workflows/dev-image.yml'
|
||||||
- '.dockerignore'
|
- '.dockerignore'
|
||||||
@ -40,4 +40,4 @@ jobs:
|
|||||||
- run: make cirun cmd="npm ci"
|
- run: make cirun cmd="npm ci"
|
||||||
- run: make ciall
|
- run: make ciall
|
||||||
- run: make push
|
- run: make push
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/main'
|
||||||
|
18
.github/workflows/test.yml
vendored
18
.github/workflows/test.yml
vendored
@ -3,7 +3,7 @@ name: 'Test'
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '*.md'
|
- '*.md'
|
||||||
pull_request:
|
pull_request:
|
||||||
@ -72,26 +72,26 @@ jobs:
|
|||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
- name: Remove lint-staged husky
|
- name: Remove lint-staged husky
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/main'
|
||||||
run: |
|
run: |
|
||||||
npm uninstall lint-staged husky
|
npm uninstall lint-staged husky
|
||||||
git checkout package-lock.json package.json
|
git checkout package-lock.json package.json
|
||||||
|
|
||||||
- name: Setup mdBook
|
- name: Setup mdBook
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/main'
|
||||||
uses: peaceiris/actions-mdbook@v1.1.12
|
uses: peaceiris/actions-mdbook@v1.1.12
|
||||||
with:
|
with:
|
||||||
mdbook-version: '0.3.7'
|
mdbook-version: '0.3.7'
|
||||||
|
|
||||||
- name: Build site
|
- name: Build site
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/main'
|
||||||
working-directory: ./test_projects/mdbook
|
working-directory: ./test_projects/mdbook
|
||||||
run: mdbook build
|
run: mdbook build
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
if: |
|
if: |
|
||||||
startsWith(matrix.os, 'ubuntu-18.04') &&
|
startsWith(matrix.os, 'ubuntu-18.04') &&
|
||||||
github.ref == 'refs/heads/master'
|
github.ref == 'refs/heads/main'
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
@ -110,7 +110,7 @@ jobs:
|
|||||||
- name: Deploy
|
- name: Deploy
|
||||||
if: |
|
if: |
|
||||||
startsWith(matrix.os, 'ubuntu-16.04') &&
|
startsWith(matrix.os, 'ubuntu-16.04') &&
|
||||||
github.ref == 'refs/heads/master'
|
github.ref == 'refs/heads/main'
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
@ -128,7 +128,7 @@ jobs:
|
|||||||
- name: Deploy
|
- name: Deploy
|
||||||
if: |
|
if: |
|
||||||
startsWith(matrix.os, 'macos') &&
|
startsWith(matrix.os, 'macos') &&
|
||||||
github.ref == 'refs/heads/master'
|
github.ref == 'refs/heads/main'
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
@ -147,7 +147,7 @@ jobs:
|
|||||||
- name: Deploy
|
- name: Deploy
|
||||||
if: |
|
if: |
|
||||||
startsWith(matrix.os, 'windows') &&
|
startsWith(matrix.os, 'windows') &&
|
||||||
github.ref == 'refs/heads/master'
|
github.ref == 'refs/heads/main'
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
@ -166,7 +166,7 @@ jobs:
|
|||||||
- name: Deploy
|
- name: Deploy
|
||||||
if: |
|
if: |
|
||||||
startsWith(matrix.os, 'ubuntu-20.04') &&
|
startsWith(matrix.os, 'ubuntu-20.04') &&
|
||||||
github.ref == 'refs/heads/master'
|
github.ref == 'refs/heads/main'
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
|
16
release.sh
16
release.sh
@ -3,9 +3,11 @@
|
|||||||
# fail on unset variables and command errors
|
# fail on unset variables and command errors
|
||||||
set -eu -o pipefail # -x: is for debugging
|
set -eu -o pipefail # -x: is for debugging
|
||||||
|
|
||||||
|
DEFAULT_BRANCH="main"
|
||||||
|
|
||||||
CURRENT_BRANCH="$(git branch --show-current)"
|
CURRENT_BRANCH="$(git branch --show-current)"
|
||||||
if [ "${CURRENT_BRANCH}" != "master" ]; then
|
if [ "${CURRENT_BRANCH}" != "${DEFAULT_BRANCH}" ]; then
|
||||||
echo "$0: Current branch ${CURRENT_BRANCH} is not master, continue? (y/n)"
|
echo "$0: Current branch ${CURRENT_BRANCH} is not ${DEFAULT_BRANCH}, continue? (y/n)"
|
||||||
read -r res
|
read -r res
|
||||||
if [ "${res}" = "n" ]; then
|
if [ "${res}" = "n" ]; then
|
||||||
echo "$0: Stop script"
|
echo "$0: Stop script"
|
||||||
@ -14,7 +16,7 @@ if [ "${CURRENT_BRANCH}" != "master" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
PRERELEASE_TYPE_LIST="prerelease prepatch preminor premajor"
|
PRERELEASE_TYPE_LIST="prerelease prepatch preminor premajor"
|
||||||
if [ "${CURRENT_BRANCH}" != "master" ]; then
|
if [ "${CURRENT_BRANCH}" != "${DEFAULT_BRANCH}" ]; then
|
||||||
RELEASE_TYPE_LIST="${PRERELEASE_TYPE_LIST}"
|
RELEASE_TYPE_LIST="${PRERELEASE_TYPE_LIST}"
|
||||||
else
|
else
|
||||||
RELEASE_TYPE_LIST="${PRERELEASE_TYPE_LIST} patch minor major"
|
RELEASE_TYPE_LIST="${PRERELEASE_TYPE_LIST} patch minor major"
|
||||||
@ -37,10 +39,10 @@ if [ "${res}" = "n" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
git fetch origin
|
git fetch origin
|
||||||
if [ "${CURRENT_BRANCH}" != "master" ]; then
|
if [ "${CURRENT_BRANCH}" != "${DEFAULT_BRANCH}" ]; then
|
||||||
git pull origin "${CURRENT_BRANCH}"
|
git pull origin "${CURRENT_BRANCH}"
|
||||||
else
|
else
|
||||||
git pull origin master
|
git pull origin ${DEFAULT_BRANCH}
|
||||||
git tag -d v3 || true
|
git tag -d v3 || true
|
||||||
git pull origin --tags
|
git pull origin --tags
|
||||||
fi
|
fi
|
||||||
@ -58,10 +60,10 @@ git rm ./lib/index.js
|
|||||||
rm -rf ./lib
|
rm -rf ./lib
|
||||||
git commit -m "chore(release): Remove build assets [skip ci]"
|
git commit -m "chore(release): Remove build assets [skip ci]"
|
||||||
|
|
||||||
if [ "${CURRENT_BRANCH}" != "master" ]; then
|
if [ "${CURRENT_BRANCH}" != "${DEFAULT_BRANCH}" ]; then
|
||||||
git push origin "${CURRENT_BRANCH}"
|
git push origin "${CURRENT_BRANCH}"
|
||||||
else
|
else
|
||||||
git push origin master
|
git push origin ${DEFAULT_BRANCH}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TAG_NAME="v$(jq -r '.version' ./package.json)"
|
TAG_NAME="v$(jq -r '.version' ./package.json)"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user