-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (43 loc) · 1.36 KB
/
release.yaml
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
name: Release
on:
push:
tags: ['v*']
defaults:
run:
shell: bash
jobs:
draft-release:
name: Create draft release
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/setup
with:
python-version: "3.9"
venv-id: "release"
poetry-dependency-install-flags: "--all-extras"
- name: Add version to environment
run: |
PROJECT_VERSION=$(poetry version --short)
echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_ENV
- name: Run tests
run: |
poetry run pytest -r a -v src tests --doctest-modules
- name: Build package
run: |
poetry build --no-interaction
- name: Generate Release Notes
run: |
git log $(git describe --tags --abbrev=0 HEAD^)..HEAD --pretty='format:* %h %s' --no-merges >> ".github/release_template.md"
- name: Create Release Draft
uses: softprops/action-gh-release@v1
with:
body_path: ".github/release_template.md"
token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
draft: true
files: |
dist/faostat_data_primap-${{ env.PROJECT_VERSION }}-py3-none-any.whl
dist/faostat_data_primap-${{ env.PROJECT_VERSION }}.tar.gz