-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6aba921
commit 6619bbc
Showing
4 changed files
with
132 additions
and
3 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,118 @@ | ||
# Create release and publish to Pypi when pushing tags | ||
|
||
name: publish | ||
|
||
# Trigger the workflow on push tags, matching vM.n.p, i.e. v3.2.10 | ||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
|
||
# Jobs to do: | ||
# - build package | ||
# - create release with asset | ||
# - publish to Pypi | ||
jobs: | ||
|
||
# ----------------------------------------------------------- | ||
# create python env and setup package | ||
# ----------------------------------------------------------- | ||
build: | ||
|
||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3.x | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel | ||
# build package for tags, e.g. 3.2.1 extracted from 'refs/tags/v3.2.1' | ||
- name: Build package | ||
run: | | ||
echo ${GITHUB_REF#refs/tags/v} > version.txt | ||
python setup.py sdist --formats=gztar,zip | ||
python setup.py bdist_wheel | ||
# upload the artifacts for further jobs | ||
# - app-tag.tar.gz | ||
# - app-tag.zip | ||
# - app-tag-info.whl | ||
- name: Archive package | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: dist | ||
path: ./dist | ||
|
||
# ----------------------------------------------------------- | ||
# create release and upload asset | ||
# ----------------------------------------------------------- | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
# Run this job after build completes successfully | ||
needs: build | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
# download artifacts from job: build | ||
- name: Download artifacts from build | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: dist | ||
path: dist | ||
|
||
# create release and upload assets | ||
- name: Create release with assets | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
./dist/*.tar.gz | ||
./dist/*.zip | ||
./dist/*.whl | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
||
# ----------------------------------------------------------- | ||
# publish to Pypi | ||
# ----------------------------------------------------------- | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
# Run this job after both build and release completes successfully | ||
needs: [build, release] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Download artifacts from release | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: dist | ||
path: dist | ||
|
||
# Error when two sdist files created in build job are uploaded to Pipi: | ||
# HTTPError: 400 Bad Request from https://upload.pypi.org/legacy/ | ||
# Only one sdist may be uploaded per release. | ||
- name: Remove duplicated sdist | ||
run: rm ./dist/*.zip | ||
|
||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
password: ${{ secrets.PYPI_PASSWORD }} |
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 |
---|---|---|
@@ -1 +1,11 @@ | ||
recursive-include pyaddin/res * | ||
include *.md | ||
include LICENSE | ||
include requirements.txt | ||
include add-in.png | ||
|
||
include pyaddin/resources/main.py | ||
include pyaddin/resources/main.cfg | ||
include pyaddin/resources/CustomUI.xml | ||
recursive-include pyaddin/resources/scripts *.py | ||
recursive-include pyaddin/resources/vba * | ||
recursive-include pyaddin/resources/xlam * |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
中文 | [English](./README_CN.md) | ||
[English](README.md) | Chinese | ||
|
||
# PyAddin | ||
|
||
|
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
[中文](./README_CN.md) | English | ||
English | [Chinese](README_CN.md) | ||
|
||
|
||
# PyAddin | ||
|
||
|