Skip to content

Commit 26f7216

Browse files
committed
Actions version update
1 parent 67a51e2 commit 26f7216

File tree

2 files changed

+110
-109
lines changed

2 files changed

+110
-109
lines changed

.github/workflows/release.yml

Lines changed: 82 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Upload Python Package
22

33
on:
44
push:
5-
branches: ['master']
5+
branches: [ 'master' ]
66
paths-ignore:
77
- '.github/**'
88
- CHANGELOG.md
@@ -22,99 +22,96 @@ jobs:
2222
deploy:
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@v2
25+
- name: Checkout repository
26+
uses: actions/checkout@v3
2627

27-
- name: Generate versions
28-
uses: HardNorth/github-version-generate@v1.2.0
29-
with:
30-
version-source: file
31-
version-file: ${{ env.VERSION_FILE }}
32-
version-file-extraction-pattern: ${{ env.VERSION_EXTRACT_PATTERN }}
28+
- name: Generate versions
29+
uses: HardNorth/github-version-generate@v1
30+
with:
31+
version-source: file
32+
version-file: ${{ env.VERSION_FILE }}
33+
version-file-extraction-pattern: ${{ env.VERSION_EXTRACT_PATTERN }}
3334

34-
- name: Setup git credentials
35-
uses: oleksiyrudenko/gha-git-credentials@v2
36-
with:
37-
name: 'reportportal.io'
38-
39-
token: ${{ secrets.GITHUB_TOKEN }}
35+
- name: Setup git credentials
36+
uses: oleksiyrudenko/gha-git-credentials@v2.1
37+
with:
38+
name: 'reportportal.io'
39+
40+
token: ${{ secrets.GITHUB_TOKEN }}
4041

41-
- name: Tagging new version
42-
id: newVersionTag
43-
run: |
44-
git tag -a ${{ env.RELEASE_VERSION }} -m "Release ${{ env.RELEASE_VERSION }}"
45-
git push --tags
42+
- name: Tagging new version
43+
id: newVersionTag
44+
run: |
45+
git tag -a ${{ env.RELEASE_VERSION }} -m "Release ${{ env.RELEASE_VERSION }}"
46+
git push --tags
4647
47-
- name: Set up Python
48-
uses: actions/setup-python@v1
49-
with:
50-
python-version: '3.6'
48+
- name: Set up Python
49+
uses: actions/setup-python@v4
50+
with:
51+
python-version: '3.6'
5152

52-
- name: Install dependencies
53-
run: |
54-
python -m pip install --upgrade pip
55-
pip install setuptools wheel twine
53+
- name: Install dependencies
54+
run: |
55+
python -m pip install --upgrade pip
56+
pip install setuptools wheel twine
5657
57-
- name: Build and publish
58-
env:
59-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
60-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
61-
run: |
62-
python setup.py sdist bdist_wheel
63-
twine upload dist/*
58+
- name: Build and publish
59+
env:
60+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
61+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
62+
run: |
63+
python setup.py sdist bdist_wheel
64+
twine upload dist/*
6465
65-
- name: Checkout develop branch
66-
uses: actions/checkout@v2
67-
with:
68-
ref: 'develop'
69-
fetch-depth: 0
66+
- name: Checkout develop branch
67+
uses: actions/checkout@v3
68+
with:
69+
ref: 'develop'
70+
fetch-depth: 0
7071

71-
- name: Update CHANGELOG.md
72-
id: changelogUpdate
73-
run: |
74-
sed '/\[Unreleased\]/q' ${{ env.CHANGE_LOG_FILE }} >> ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }}
75-
sed -E '1,/#?#\s*\[Unreleased\]/d' ${{ env.CHANGE_LOG_FILE }} | sed -E '/#?#\s*\[/q' | \
76-
{ echo -e '\n## [${{ env.RELEASE_VERSION }}]'; sed '$d'; } >> ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }}
77-
grep -E '#?#\s*\[[0-9]' ${{ env.CHANGE_LOG_FILE }} | head -n1 >> ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }}
78-
sed -E '1,/#?#\s*\[[0-9]/d' ${{ env.CHANGE_LOG_FILE }} >> ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }}
79-
rm ${{ env.CHANGE_LOG_FILE }}
80-
mv ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }} ${{ env.CHANGE_LOG_FILE }}
81-
git add ${{ env.CHANGE_LOG_FILE }}
82-
git commit -m "Changelog update"
72+
- name: Update CHANGELOG.md
73+
id: changelogUpdate
74+
run: |
75+
sed '/\[Unreleased\]/q' ${{ env.CHANGE_LOG_FILE }} >> ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }}
76+
sed -E '1,/#?#\s*\[Unreleased\]/d' ${{ env.CHANGE_LOG_FILE }} | sed -E '/#?#\s*\[/q' | \
77+
{ echo -e '\n## [${{ env.RELEASE_VERSION }}]'; sed '$d'; } >> ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }}
78+
grep -E '#?#\s*\[[0-9]' ${{ env.CHANGE_LOG_FILE }} | head -n1 >> ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }}
79+
sed -E '1,/#?#\s*\[[0-9]/d' ${{ env.CHANGE_LOG_FILE }} >> ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }}
80+
rm ${{ env.CHANGE_LOG_FILE }}
81+
mv ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }} ${{ env.CHANGE_LOG_FILE }}
82+
git add ${{ env.CHANGE_LOG_FILE }}
83+
git commit -m "Changelog update"
8384
84-
- name: Read changelog Entry
85-
id: readChangelogEntry
86-
uses: mindsers/changelog-reader-action@v1.3.1
87-
with:
88-
version: ${{ env.RELEASE_VERSION }}
89-
path: ./${{ env.CHANGE_LOG_FILE }}
85+
- name: Read changelog Entry
86+
id: readChangelogEntry
87+
uses: mindsers/changelog-reader-action@v2
88+
with:
89+
version: ${{ env.RELEASE_VERSION }}
90+
path: ./${{ env.CHANGE_LOG_FILE }}
9091

91-
- name: Create Release
92-
id: createRelease
93-
uses: actions/create-release@v1
94-
env:
95-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96-
with:
97-
tag_name: ${{ env.RELEASE_VERSION }}
98-
release_name: Release ${{ env.RELEASE_VERSION }}
99-
body: ${{ steps.readChangelogEntry.outputs.log_entry }}
100-
draft: false
101-
prerelease: false
92+
- name: Create Release
93+
id: createRelease
94+
uses: ncipollo/release-action@v1
95+
with:
96+
tag: ${{ env.RELEASE_VERSION }}
97+
name: Release ${{ env.RELEASE_VERSION }}
98+
body: ${{ steps.readChangelogEntry.outputs.changes }}
10299

103-
- name: Merge release branch into develop
104-
id: mergeIntoDevelop
105-
run: |
106-
git merge -m 'Merge master branch into develop after a release' origin/master
107-
git status | (! grep -Fq 'both modified:') || git status | grep -F 'both modified:' \
108-
| { echo -e 'Unable to merge master into develop, merge conflicts:'; (! grep -Eo '[^ ]+$') }
100+
- name: Merge release branch into develop
101+
id: mergeIntoDevelop
102+
run: |
103+
git merge -m 'Merge master branch into develop after a release' origin/master
104+
git status | (! grep -Fq 'both modified:') || git status | grep -F 'both modified:' \
105+
| { echo -e 'Unable to merge master into develop, merge conflicts:'; (! grep -Eo '[^ ]+$') }
109106
110-
- name: Update version file
111-
id: versionFileUpdate
112-
run: |
113-
export CURRENT_VERSION_VALUE=`echo '${{ env.CURRENT_VERSION }}' | sed -E "s/(.*)/${{ env.VERSION_REPLACE_PATTERN }}/"`
114-
export NEXT_VERSION_VALUE=`echo '${{ env.NEXT_VERSION }}' | sed -E "s/(.*)/${{ env.VERSION_REPLACE_PATTERN }}/"`
115-
sed "s/${CURRENT_VERSION_VALUE}/${NEXT_VERSION_VALUE}/g" ${{ env.VERSION_FILE }} > ${{ env.VERSION_FILE }}${{ env.TMP_SUFFIX }}
116-
rm ${{ env.VERSION_FILE }}
117-
mv ${{ env.VERSION_FILE }}${{ env.TMP_SUFFIX }} ${{ env.VERSION_FILE }}
118-
git add ${{ env.VERSION_FILE }}
119-
git commit -m "Version update"
120-
git push
107+
- name: Update version file
108+
id: versionFileUpdate
109+
run: |
110+
export CURRENT_VERSION_VALUE=`echo '${{ env.CURRENT_VERSION }}' | sed -E "s/(.*)/${{ env.VERSION_REPLACE_PATTERN }}/"`
111+
export NEXT_VERSION_VALUE=`echo '${{ env.NEXT_VERSION }}' | sed -E "s/(.*)/${{ env.VERSION_REPLACE_PATTERN }}/"`
112+
sed "s/${CURRENT_VERSION_VALUE}/${NEXT_VERSION_VALUE}/g" ${{ env.VERSION_FILE }} > ${{ env.VERSION_FILE }}${{ env.TMP_SUFFIX }}
113+
rm ${{ env.VERSION_FILE }}
114+
mv ${{ env.VERSION_FILE }}${{ env.TMP_SUFFIX }} ${{ env.VERSION_FILE }}
115+
git add ${{ env.VERSION_FILE }}
116+
git commit -m "Version update"
117+
git push

.github/workflows/tests.yml

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,40 @@ name: Tests
33
on:
44
push:
55
branches:
6-
- '*'
7-
- '!master'
6+
- '*'
7+
- '!master'
88
pull_request:
99
branches:
10-
- 'master'
11-
- 'develop'
10+
- 'master'
11+
- 'develop'
1212

1313
jobs:
1414
build:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
python-version: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10']
18+
python-version: [ '2.7', '3.6', '3.7', '3.8', '3.9', '3.10' ]
1919
steps:
20-
- uses: actions/checkout@v2
21-
- name: Set up Python ${{ matrix.python-version }}
22-
uses: actions/setup-python@v2
23-
with:
24-
python-version: ${{ matrix.python-version }}
25-
- name: Install dependencies
26-
run: |
27-
python -m pip install --upgrade pip
28-
pip install tox tox-gh-actions
29-
- name: Test with tox
30-
run: tox
31-
- name: Upload coverage to Codecov
32-
if: matrix.python-version == 3.6 && success()
33-
uses: codecov/codecov-action@v1
34-
with:
35-
files: coverage.xml
36-
flags: unittests
37-
name: codecov-client-reportportal
38-
path_to_write_report: codecov_report.txt
20+
- name: Checkout repository
21+
uses: actions/checkout@v3
22+
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install tox tox-gh-actions
32+
33+
- name: Test with tox
34+
run: tox
35+
36+
- name: Upload coverage to Codecov
37+
if: matrix.python-version == 3.6 && success()
38+
uses: codecov/codecov-action@v3
39+
with:
40+
files: coverage.xml
41+
flags: unittests
42+
name: codecov-client-reportportal

0 commit comments

Comments
 (0)