-
-
Notifications
You must be signed in to change notification settings - Fork 8
60 lines (51 loc) · 1.7 KB
/
publish.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
name: GNOME Extension Pack
on:
workflow_dispatch: # Allow manual triggers
inputs:
tags:
description: 'Tags'
required: false
push:
# Publish `v1.2.3` tags as releases.
tags:
- v*
env:
# Change variable to your extension name.
NAME: customize-ibus
jobs:
# Pack Extension and Upload
push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install gettext
- name: Setup Version
run: |
if [ ! -z "${{ github.event.inputs.tags }}" ]
then
version=${{ github.event.inputs.tags }}
echo "VERSION=${{ github.event.inputs.tags }}" >> $GITHUB_ENV
else
version=$(echo '${{ github.ref }}' | sed -e 's,.*/\(.*\),\1,')
echo "VERSION=$version" >> $GITHUB_ENV
fi
num=$(echo $version | sed -e 's/^v//')
echo "VERSION_NUM=$num" >> $GITHUB_ENV
- name: Update Translation
run: make potfile VERSION=${{ env.VERSION_NUM }} && make mergepo VERSION=${{ env.VERSION_NUM }}
- name: Zip Files
run: make zip VERSION=${{ env.VERSION_NUM }}
- name: Upload Zipped Files to release
uses: svenstaro/upload-release-action@master
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.NAME }}_${{ env.VERSION }}.zip
tag: ${{ env.VERSION }}
overwrite: true
- name: Upload Zipped Files to Artifact
uses: actions/upload-artifact@master
with:
name: ${{ env.NAME }}_${{ env.VERSION }}.zip
path: ${{ env.NAME }}_${{ env.VERSION }}.zip