-
Notifications
You must be signed in to change notification settings - Fork 2
82 lines (81 loc) · 2.44 KB
/
ci.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
81
82
name: CI
on:
pull_request:
push:
branches:
- main
tags:
- '*'
workflow_dispatch:
jobs:
lint-and-test:
name: Lint and test
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.10']
os: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install
run: pip install -e ./src/ros_d2
- uses: pre-commit/[email protected]
release:
name: Release
env:
DIST_ARCHIVE_NAME: ${{ github.event.repository.name }}-dist
runs-on: ${{ matrix.os }}
needs: [lint-and-test]
if: startsWith(github.ref, 'refs/tags/')
strategy:
matrix:
python-version: ['3.10']
os: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Build changelog
id: build_changelog
uses: mikepenz/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
configuration: '.github/config/changelog_configuration.json'
ignorePreReleases: 'false'
- name: Package release
uses: papeloto/action-zip@v1
with:
files: ./
recursive: false
dest: ${{ env.DIST_ARCHIVE_NAME }}-${{ steps.get_version.outputs.VERSION }}.zip
- name: Release
uses: softprops/action-gh-release@v1
with:
body: ${{steps.build_changelog.outputs.changelog}}
files: |
${{ env.DIST_ARCHIVE_NAME }}-${{ steps.get_version.outputs.VERSION }}.zip
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
- name: Build and Publish to PyPi
shell: bash
working-directory: ./src/ros_d2
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
TWINE_NON_INTERACTIVE: true
run: |
cp ../../README.md .
python3 -m pip install --user --upgrade setuptools wheel
python3 setup.py sdist bdist_wheel
python3 -m pip install --user --upgrade twine
python3 -m twine upload dist/*