Skip to content

Commit

Permalink
fix: Simplify CI flow and use master only (#1626)
Browse files Browse the repository at this point in the history
* fix: Simplify CI flow and use master only

* Remove spaces
  • Loading branch information
faucomte97 committed Feb 22, 2022
1 parent aeeda78 commit 586fa02
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 75 deletions.
79 changes: 4 additions & 75 deletions .github/workflows/cicd.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: CI/CD
on:
push:
branches:
- development
- master
release:
types: [published]
pull_request:
jobs:
test:
Expand All @@ -17,8 +15,8 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.7.x
architecture: x64
python-version: "3.7"
architecture: "x64"
- name: Use Node.js
uses: actions/setup-node@v1
with:
Expand Down Expand Up @@ -127,72 +125,3 @@ jobs:
docker cp -a $CONTAINERID:coverage.xml $(pwd)/coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1

publish-python:
name: Publish aimmo PyPi package
needs: [test, test-aimmo-game, test-aimmo-game-creator, test-aimmo-game-worker]
if: github.event_name == 'push' && github.event.head_commit.author.email != 'action@github.com'
runs-on: ubuntu-18.04
env:
NODE_ENV: production
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.7.x
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install frontend dependencies
run: |
cd game_frontend
yarn --frozen-lockfile
- name: Install wheel
run: pip install wheel
- name: Build worker wheel
run: ./aimmo_runner/build_worker_wheel.sh
- name: Bundle Frontend
run: |
cd game_frontend
node djangoBundler.js
- name: Set branch
id: branch
run: |
echo "::set-output name=branch::${GITHUB_REF##*/}" # get the substring from GITHUB_REF after the last '/'
- name: Release aimmo
uses: ocadotechnology/python-semantic-release@updated-beta-releases
with:
github_token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
pypi_token: ${{ secrets.PYPI_TOKEN }}
branch: ${{ steps.branch.outputs.branch }}
build: ${{ github.run_number }}

merge-master-into-development:
name: Merge master into development after release
needs: [publish-python]
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-18.04
steps:
- name: Checkout development branch
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: development
persist-credentials: false
- name: Setup git username
run: |
git config --global user.name "github-actions"
git config --global user.email "action@github.com"
- name: Merge master into development
run: |
git merge origin/master
git remote add authed-origin https://${GH_TOKEN}@github.com/ocadotechnology/aimmo.git > /dev/null 2>&1
git push --quiet --set-upstream authed-origin development
env:
GH_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
44 changes: 44 additions & 0 deletions .github/workflows/publish-python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish Python Package
on:
push:
branches:
- master
paths-ignore:
- "CHANGELOG.md"
- "aimmo/__init__.py"
jobs:
publish-pypi-package:
name: Publish PyPi Package
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.7"
architecture: "x64"
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install frontend dependencies
run: |
cd game_frontend
yarn --frozen-lockfile
- name: Install wheel
run: pip install wheel
- name: Build worker wheel
run: ./aimmo_runner/build_worker_wheel.sh
- name: Bundle Frontend
run: |
cd game_frontend
node djangoBundler.js
- name: Release aimmo
uses: relekang/python-semantic-release@v7.12.0
with:
github_token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
pypi_token: ${{ secrets.PYPI_TOKEN }}

0 comments on commit 586fa02

Please sign in to comment.