-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/ballerina-platform/baller…
- Loading branch information
Showing
7 changed files
with
322 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import requests | ||
import sys | ||
import shutil | ||
import os | ||
|
||
response = requests.get("https://api.github.com/repos/ballerina-platform/ballerina-spec/releases/latest") | ||
|
||
updated_spec = open("updated_spec.md", 'a') | ||
|
||
spec_version = response.json()["name"] | ||
release_date = response.json()["published_at"][0:10] | ||
release_note = response.json()["body"] | ||
|
||
with open(sys.argv[1],'r') as read_obj: | ||
for line in read_obj.readlines(): | ||
if "| ------- | ------------ | ----------- |" in line: | ||
updated_spec.write(line) | ||
updated_spec.write('| <a target="_blank" href="/spec/lang/'+spec_version+'/">'+spec_version+'</a> | '+release_date+' | '+release_note+' |\n') | ||
continue | ||
updated_spec.write(line) | ||
|
||
os.remove(sys.argv[1]) | ||
shutil.copy("updated_spec.md",sys.argv[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Delete draft spec release in ballerina.io | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Version of the draft (directory name)' | ||
required: true | ||
default: '' | ||
|
||
jobs: | ||
delete_release_spec: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.BAL_BOT_PAT }} | ||
|
||
steps: | ||
- name: Checkout ballerina-spec | ||
uses: actions/checkout@v2 | ||
|
||
- name: Clone ballerina-dev-website | ||
run: git clone -b master --single-branch https://ballerina-bot:[email protected]/ballerina-platform/ballerina-dev-website.git | ||
|
||
- name: Clone ballerina-prod-website | ||
run: git clone https://ballerina-bot:[email protected]/ballerina-platform/ballerina-platform.github.io.git | ||
|
||
- name: Delete spec directory from ballerina-dev-website | ||
run: | | ||
cd ballerina-dev-website | ||
git pull origin master | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "ballerina-bot" | ||
if [ -d "spec/lang/draft/${{ github.event.inputs.version }}" ]; then rm -Rf "spec/lang/draft/${{ github.event.inputs.version }}"; else echo "${{ github.event.inputs.version }} directory not found"; fi | ||
git add spec/lang/draft | ||
git commit --allow-empty -m "[Automated] Delete draft in master" | ||
- name: Delete spec directory from ballerina-prod-website | ||
run: | | ||
cd ballerina-platform.github.io | ||
git pull origin master | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "ballerina-bot" | ||
if [ -d "spec/lang/draft/${{ github.event.inputs.version }}" ]; then rm -Rf "spec/lang/draft/${{ github.event.inputs.version }}"; else echo "${{ github.event.inputs.version }} directory not found"; fi | ||
git add spec/lang/draft | ||
git commit --allow-empty -m "[Automated] Delete draft in master" | ||
- name: Push new changes to ballerina-dev-website | ||
shell: bash | ||
run: | | ||
cd ballerina-dev-website | ||
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 | ||
bin/hub push | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.BAL_BOT_PAT }} | ||
|
||
- name: Push new changes to ballerina-prod-website | ||
shell: bash | ||
run: | | ||
cd ballerina-platform.github.io | ||
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 | ||
bin/hub push | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.BAL_BOT_PAT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Delete major spec release in ballerina.io | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Version of the spec release (directory name)' | ||
required: true | ||
default: '' | ||
|
||
jobs: | ||
delete_release_spec: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.BAL_BOT_PAT }} | ||
|
||
steps: | ||
- name: Checkout ballerina-spec | ||
uses: actions/checkout@v2 | ||
|
||
- name: Clone ballerina-dev-website | ||
run: git clone -b master --single-branch https://ballerina-bot:[email protected]/ballerina-platform/ballerina-dev-website.git | ||
|
||
- name: Clone ballerina-prod-website | ||
run: git clone https://ballerina-bot:[email protected]/ballerina-platform/ballerina-platform.github.io.git | ||
|
||
- name: Delete spec directory from ballerina-dev-website | ||
run: | | ||
cd ballerina-dev-website | ||
git pull origin master | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "ballerina-bot" | ||
if [ -d "spec/lang/${{ github.event.inputs.version }}" ]; then rm -Rf "spec/lang/${{ github.event.inputs.version }}"; else echo "${{ github.event.inputs.version }} directory not found"; fi | ||
git add spec/lang | ||
git commit --allow-empty -m "[Automated] Delete major release in master" | ||
- name: Delete spec directory from ballerina-prod-website | ||
run: | | ||
cd ballerina-platform.github.io | ||
git pull origin master | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "ballerina-bot" | ||
if [ -d "spec/lang/${{ github.event.inputs.version }}" ]; then rm -Rf "spec/lang/${{ github.event.inputs.version }}"; else echo "${{ github.event.inputs.version }} directory not found"; fi | ||
git add spec/lang | ||
git commit --allow-empty -m "[Automated] Delete major release in master" | ||
- name: Push new changes to ballerina-dev-website | ||
shell: bash | ||
run: | | ||
cd ballerina-dev-website | ||
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 | ||
bin/hub push | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.BAL_BOT_PAT }} | ||
|
||
- name: Push new changes to ballerina-prod-website | ||
shell: bash | ||
run: | | ||
cd ballerina-platform.github.io | ||
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 | ||
bin/hub push | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.BAL_BOT_PAT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,11 @@ name: Sync draft spec with ballerina.io | |
on: | ||
push: | ||
tags: | ||
- '*' | ||
- 'v*-*-*' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
sync_draft_spec: | ||
if: contains(github.ref_name, '-') | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.BAL_BOT_PAT }} | ||
|
@@ -20,6 +19,9 @@ jobs: | |
- name: Clone ballerina-dev-website | ||
run: git clone -b master --single-branch https://ballerina-bot:[email protected]/ballerina-platform/ballerina-dev-website.git | ||
|
||
- name: Clone ballerina-prod-website | ||
run: git clone https://ballerina-bot:[email protected]/ballerina-platform/ballerina-platform.github.io.git | ||
|
||
- name: Make new folder location in ballerina-dev-website | ||
run: | | ||
cd ballerina-dev-website/spec/lang/draft | ||
|
@@ -30,11 +32,22 @@ jobs: | |
mkdir "${array[len-1]}" | ||
echo "NEW_FOLDER=${array[len-1]}" >> $GITHUB_ENV | ||
- name: Make new folder location in ballerina-prod-website | ||
run: | | ||
cd ballerina-platform.github.io/spec/lang/draft | ||
if [ -d "${NEW_FOLDER}" ]; then rm -Rf "${NEW_FOLDER}"; fi | ||
mkdir "${NEW_FOLDER}" | ||
- name: Update the latest to new url in ballerina-dev-website | ||
run: | | ||
cd ballerina-dev-website/spec/lang/draft/latest | ||
echo -e "---\nredirect_to: /spec/lang/draft/$NEW_FOLDER/\n---" > index.md | ||
- name: Update the latest to new url in ballerina-prod-website | ||
run: | | ||
cd ballerina-platform.github.io/spec/lang/draft/latest | ||
echo -e "---\nredirect_to: /spec/lang/draft/$NEW_FOLDER/\n---" > index.md | ||
- name: Install xsltproc | ||
run: sudo apt-get install -y xsltproc | ||
|
||
|
@@ -48,9 +61,15 @@ jobs: | |
- name: Copy new spec to ballerina-dev-website | ||
run: cp -r lang/build/* ballerina-dev-website/spec/lang/draft/$NEW_FOLDER | ||
|
||
- name: Copy new spec to ballerina-prod-website | ||
run: cp -r lang/build/* ballerina-platform.github.io/spec/lang/draft/$NEW_FOLDER | ||
|
||
- name: Update the list of draft specs in ballerina-dev-website | ||
run: python3 .github/scripts/append.py ballerina-dev-website/_data/draft_spec.json $NEW_FOLDER | ||
|
||
- name: Update the list of draft specs in ballerina-prod-website | ||
run: python3 .github/scripts/append.py ballerina-platform.github.io/_data/draft_spec.json $NEW_FOLDER | ||
|
||
- name: Sync ballerina-spec with ballerina-dev-website | ||
run: | | ||
cd ballerina-dev-website | ||
|
@@ -62,6 +81,18 @@ jobs: | |
git add _data/draft_spec.json | ||
git add spec/lang/draft/ | ||
git commit --allow-empty -m "[Automated] Sync new spec-tag with ballerina dev site" | ||
- name: Sync ballerina-spec with ballerina-prod-website | ||
run: | | ||
cd ballerina-platform.github.io | ||
git pull origin master | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "ballerina-bot" | ||
git add _data/draft_spec.json | ||
git add spec/lang/draft/ | ||
git commit --allow-empty -m "[Automated] Sync new spec-tag with ballerina prod site" | ||
- name: Push new changes to ballerina-dev-website | ||
shell: bash | ||
|
@@ -71,3 +102,12 @@ jobs: | |
bin/hub push | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.BAL_BOT_PAT }} | ||
|
||
- name: Push new changes to ballerina-prod-website | ||
shell: bash | ||
run: | | ||
cd ballerina-platform.github.io | ||
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 | ||
bin/hub push | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.BAL_BOT_PAT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ on: | |
- master | ||
paths-ignore: | ||
- '.github/**' | ||
- 'conformance/**' | ||
|
||
jobs: | ||
sync_master_spec: | ||
|
@@ -18,7 +19,7 @@ jobs: | |
uses: actions/checkout@v2 | ||
|
||
- name: Clone ballerina-dev-website | ||
run: git clone https://ballerina-bot:[email protected]/ballerina-platform/ballerina-dev-website.git | ||
run: git clone -b master --single-branch https://ballerina-bot:[email protected]/ballerina-platform/ballerina-dev-website.git | ||
|
||
- name: Clone ballerina-prod-website | ||
run: git clone https://ballerina-bot:[email protected]/ballerina-platform/ballerina-platform.github.io.git | ||
|
@@ -35,7 +36,7 @@ jobs: | |
- name: Sync spec in master with ballerina-dev-website | ||
run: | | ||
cd ballerina-dev-website | ||
git pull origin dev | ||
git pull origin master | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "ballerina-bot" | ||
|
Oops, something went wrong.