-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (72 loc) · 2.27 KB
/
self_publish_alpha.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Build package for easyScience pypi
on:
push:
branches: [develop]
jobs:
Build_package:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Check-out repository
uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Setup Python
with:
python-version: 3.9
- uses: Gr1N/setup-poetry@v8
with:
poetry-version: 1.1.13
- name: Install and build
run: |
poetry build
- name: Set name variable
id: name
shell: bash
run: |
EDLVERSION=$( poetry version | awk -F'[" "|.|-]' '{ print $5=="" ? "v"$2"."$3"."$4 : "v"$2"."$3"."$4"-"$5 ;}' )
echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
echo "::set-output name=tag::$EDLVERSION"
- name: Upload Artifacts GitHub releases
uses: ncipollo/release-action@v1
with:
draft: false
prerelease: true
allowUpdates: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: ./**/*.whl
tag: ${{ steps.name.outputs.tag }}
body: This is an alpha build of easyCore (${{ steps.name.outputs.tag }})
- name: Generate HTML
run: |
pip install requests
python resources/scripts/generate_html.py ${{ env.REPOSITORY_NAME }}
- name: Checkout target repo
uses: actions/checkout@v3
env:
REPO: easyScience/pypi
REPO_PATH: pypi
with:
fetch-depth: 0
token: ${{ secrets.ES_TOKEN }}
repository: ${{ env.REPO }}
path: ${{ env.REPO_PATH }}
- name: Copy index to new repo
env:
SOURCE: index.html
TARGET: pypi/easysciencecore/
run: cp ${{ env.SOURCE }} ${{ env.TARGET }}
- name: Push
env:
REPO_PATH: pypi
GIT_USERNAME: action
GIT_EMAIL: action@github.com
run: |
cd ${{ env.REPO_PATH }}
git config --local user.name "${{ env.GIT_USERNAME }}"
git config --local user.email "${{ env.GIT_EMAIL }}"
git add .
if [[ `git status --porcelain` ]]; then
git commit -m "Github Actions Automatically Built in `date +"%Y-%m-%d %H:%M"`"
git push
fi