Skip to content

Commit c422bd9

Browse files
committed
[GHA] Refactor release workflow
1 parent 93cf881 commit c422bd9

2 files changed

Lines changed: 65 additions & 92 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Release-Package 🎳
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
dry-run:
7+
required: true
8+
type: boolean
9+
10+
jobs:
11+
release-package:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v6
15+
16+
- name: Fetch yapt
17+
run: |
18+
curl ${{ vars.YAPT_REPOSITORY_URL }} | tar -xzf -
19+
20+
- name: Install Qt tranlation tools
21+
run: |
22+
sudo apt-get -qq update
23+
sudo apt-get -qq install qttools5-dev-tools pyqt5-dev-tools
24+
25+
- name: Pull transifex translations
26+
run: >
27+
qt-transifex -vv pull --compile
28+
--transifex-token "${{ secrets.TRANSIFEX_TOKEN }}"
29+
30+
- name: Fetch current changelog
31+
run: |
32+
./yapt-pkg changelog >> release.md
33+
cat release.md
34+
35+
- name: Package and deploy the zip
36+
env:
37+
DRY_RUN_OPT: ${{ inputs.dry_run == true && '--dry-run' || '' }}
38+
run: echo "DRY_RUN_OPT: ${{ env.DRY_RUN_OPT }}"
39+
#run: >
40+
# ./yapt -v package --publish ${{ env.DRY_RUN_OPT }}
41+
# --osgeo-username "${{ secrets.OSGEO_USERNAME }}"
42+
# --osgeo-password "${{ secrets.OSGEO_PASSWORD }}"
43+
44+
- name: Package and deploy the zip
45+
run: >
46+
./yapt-pkg -v package --publish
47+
--osgeo-username "${{ secrets.OSGEO_USERNAME }}"
48+
--osgeo-password "${{ secrets.OSGEO_PASSWORD }}"
49+
50+
- name: Create release on GitHub
51+
if: ${{ inputs.dry_run == false }}
52+
uses: ncipollo/release-action@v1.20.0
53+
with:
54+
bodyFile: release.md
55+
artifacts: "*.zip"
56+
token: ${{ secrets.BOT_HUB_TOKEN }}
57+

.github/workflows/release.yml

Lines changed: 8 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -10,99 +10,15 @@ on:
1010
default: false
1111

1212
jobs:
13-
tests:
14-
uses: ./.github/workflows/tests.yml
15-
1613
release-dry-run:
17-
runs-on: ubuntu-latest
18-
if: github.repository_owner == '3liz' && inputs.dry_run == 'true' }}
19-
steps:
20-
- uses: actions/checkout@v6
21-
22-
- name: Setup Python
23-
uses: actions/setup-python@v6
24-
with:
25-
python-version: "3.12"
26-
architecture: x64
27-
cache: "pip"
28-
cache-dependency-path: "requirements/packaging.txt"
29-
30-
- name: Set env
31-
run: echo "RELEASE_VERSION=`qgis-plugin-ci meta -r version`" >> $GITHUB_ENV
32-
33-
- name: Install packaging CI
34-
run: |
35-
sudo apt-get -qq update
36-
sudo apt-get -qq install qttools5-dev-tools pyqt5-dev-tools
37-
pip install --quiet -r requirements/packaging.txt
38-
39-
- name: Fetch current changelog
40-
run: qgis-plugin-ci changelog ${{ env.RELEASE_VERSION }} >> release.md
41-
42-
- name: Pull transifex translations
43-
run: >
44-
qt-transifex -vv pull --compile
45-
--transifex-token "${{ secrets.TRANSIFEX_TOKEN }}"
46-
47-
- name: Package and deploy the zip
48-
run: >
49-
qgis-plugin-ci -vv release ${{ env.RELEASE_VERSION }} --dry-run
50-
--github-token "${{ secrets.BOT_HUB_TOKEN }}"
51-
--osgeo-username "${{ secrets.OSGEO_USERNAME }}"
52-
--osgeo-password "${{ secrets.OSGEO_PASSWORD }}"
14+
if: github.repository_owner == '3liz' && inputs.dry_run == true
15+
uses: ./.github/workflows/release-package.yml
16+
with:
17+
dry_run: true
5318

5419
release:
55-
needs: [tests]
56-
57-
runs-on: ubuntu-latest
58-
if: ${{ github.repository_owner == '3liz' && contains(github.ref, 'refs/tags/') && inputs.dry_run == 'false' }}
59-
steps:
60-
- uses: actions/checkout@v6
61-
62-
- name: Setup Python
63-
uses: actions/setup-python@v6
64-
with:
65-
python-version: "3.12"
66-
architecture: x64
67-
cache: "pip"
68-
cache-dependency-path: "requirements/packaging.txt"
69-
70-
- name: Install packaging CI
71-
run: |
72-
sudo apt-get -qq update
73-
sudo apt-get -qq install qttools5-dev-tools pyqt5-dev-tools
74-
pip install --quiet -r requirements/packaging.txt
75-
76-
- name: Set env
77-
run: echo "RELEASE_VERSION=`qgis-plugin-ci meta -r version`" >> $GITHUB_ENV
78-
79-
- name : Fetch current changelog
80-
run: |
81-
qgis-plugin-ci changelog ${{ env.RELEASE_VERSION }} >> release.md
82-
cat release.md
83-
84-
- name: Create release on GitHub
85-
uses: ncipollo/release-action@v1.20.0
86-
with:
87-
bodyFile: release.md
88-
token: ${{ secrets.BOT_HUB_TOKEN }}
89-
90-
- name: Pull transifex translations
91-
run: >
92-
qt-transifex -vv pull --compile
93-
--transifex-token "${{ secrets.TRANSIFEX_TOKEN }}"
94-
95-
- name: Package and deploy the zip
96-
run: >
97-
qgis-plugin-ci -vv release ${{ env.RELEASE_VERSION }} --create-plugin-repo
98-
--github-token "${{ secrets.BOT_HUB_TOKEN }}"
99-
--osgeo-username "${{ secrets.OSGEO_USERNAME }}"
100-
--osgeo-password "${{ secrets.OSGEO_PASSWORD }}"
20+
if: ${{ github.repository_owner == '3liz' && contains(github.ref, 'refs/tags/') && inputs.dry_run == false }}
21+
use: ./.github/workflows/release-package.yml
22+
with:
23+
dry_run: false
10124

102-
- name: Repository Dispatch
103-
uses: peter-evans/repository-dispatch@v3
104-
with:
105-
token: ${{ secrets.BOT_HUB_TOKEN }}
106-
repository: 3liz/3liz.github.io
107-
event-type: merge-plugins
108-
client-payload: '{"name": "lizmap", "version": "${{ env.RELEASE_VERSION }}", "url": "https://github.com/3liz/lizmap-plugin/releases/latest/download/plugins.xml"}'

0 commit comments

Comments
 (0)