-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·64 lines (56 loc) · 1.88 KB
/
main.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
name: Encode and generate new release for plugin
on:
pull_request:
types: [ closed ]
branches: [ main ]
env:
PLUGIN_NAME: payment-gateway-pix-for-givewp
PHP_VERSION: "7.4"
jobs:
release-build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
# Run composer install // TODO Only run composer after autoload config
#- name: Run composer install
# uses: php-actions/composer@v6
# with:
# php_version: ${{ env.PHP_VERSION }}
# working_dir: "."
# dev: no
# command: install
- name: Make plugin root directory
run: |
mkdir ${{env.PLUGIN_NAME}} &&
cp -r ./admin ./includes ./languages ./public *.php *.txt composer.json composer.lock ./${{env.PLUGIN_NAME}}/ &&
find ./${{env.PLUGIN_NAME}} -type f -exec chmod 0644 {} + &&
find ./${{env.PLUGIN_NAME}} -type d -exec chmod 0755 {} + &&
ls -lah
# Compact plugin as .zip
- name: Archive Release
uses: thedoctor0/zip-release@master
with:
type: "zip"
path: "${{ env.PLUGIN_NAME }}"
directory: "."
filename: "${{ env.PLUGIN_NAME }}.zip"
exclusions: "*.git* /*node_modules/* .editorconfig"
# Update version tag
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: "1.0.0" # This tag will be updated by the action // TODO Update this value
# Generate new release
- name: Generate new Release
uses: ncipollo/release-action@v1
with:
artifacts: "${{ env.PLUGIN_NAME }}.zip"
token: ${{ secrets.GITHUB_TOKEN }}
commit: "main"
draft: true
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}