Skip to content

Commit

Permalink
feat: add semantic release
Browse files Browse the repository at this point in the history
  • Loading branch information
leangseu-edx committed Sep 5, 2023
1 parent c134ca6 commit dfd4a1c
Show file tree
Hide file tree
Showing 8 changed files with 41,177 additions and 30,068 deletions.
74 changes: 63 additions & 11 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,82 @@ name: Publish package to PyPi

on:
push:
tags:
- '*'
branches:
- master

jobs:

push:
release:
name: Release
runs-on: ubuntu-20.04

steps:
- name: Checkout
uses: actions/checkout@v2
- name: setup python

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 16

- name: Install node packages
run: npm ci

- name: Build js
run: npm run build

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install pip
run: pip install -r requirements/pip.txt
- name: Install python Dependencies
run: |
pip install -r requirements/pip.txt
pip install -r requirements/ci.txt
pip install -r requirements/test.txt
pip install -r requirements/quality.txt
pip install -r requirements/test-acceptance.txt
- name: Install Transifex client
run: |
cd
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
cat $GITHUB_PATH
echo $(pwd) >> $GITHUB_PATH
cat $GITHUB_PATH
- name: Install GNU gettext
run: sudo apt-get install gettext

- name: update translations
env:
TX_TOKEN: ${{ secrets.EDX_TRANSIFEX_BOT_GITHUB_TOKEN }}
run: |
make update_translations
- name: Build package
- name: Release
env:
GH_TOKEN: ${{ secrets.CC_GITHUB_TOKEN }}
run: npx semantic-release

- name: Build python package
run: python setup.py sdist bdist_wheel

- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_UPLOAD_TOKEN }}
repository-url: https://test.pypi.org/legacy/

- name: Send failure notification
if: ${{ failure() }}
uses: dawidd6/action-send-mail@v3
with:
server_address: email-smtp.us-east-1.amazonaws.com
server_port: 465
username: ${{ secrets.EDX_SMTP_USERNAME }}
password: ${{ secrets.EDX_SMTP_PASSWORD }}
subject: Publish Pypi has failed in ${{github.repository}}
to: [email protected]
from: github-actions <[email protected]>
body: Publish Pypi workflow in ${{github.repository}} failed!
For details see "github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
20 changes: 20 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"branches": ["master"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/npm",
{
"npmPublish": false
}
],
[
"@semantic-release/exec",
{
"prepareCmd": "node scripts/update_version.js ${nextRelease.version}"
}
],
"@semantic-release/github"
]
}
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ push_translations: ## push source translation files (.po) to Transifex

check_translations_up_to_date: extract_translations compile_translations generate_dummy_translations detect_changed_source_translations ## extract, compile, and check if translation files are up-to-date

update_translations: extract_translations compile_translations generate_dummy_translations pull_translations ## extract, compile, and pull translations from Transifex

################
#Tests and checks
################
Expand Down
4 changes: 4 additions & 0 deletions openassessment/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
"""
Initialization Information for Open Assessment Module
"""
<<<<<<< HEAD

__version__ = '5.2.5'
=======
__version__ = '0.0.0_semantic-release'
>>>>>>> d6ab9be0 (feat: add semantic release)
Loading

0 comments on commit dfd4a1c

Please sign in to comment.