This repository has been archived by the owner on Jan 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 52
77 lines (67 loc) · 2.81 KB
/
release.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
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Handle Release
on:
release:
types: [created]
pull_request:
branches: [ master ]
types: [ closed ]
jobs:
build:
runs-on: windows-latest
if: (github.event_name == 'pull_request' && github.event.pull_request.merged == true && github.actor == 'molotovcherry' && github.head_ref == 'imupdate') || github.event_name == 'release'
steps:
- uses: actions/checkout@v2
- uses: nttld/setup-ndk@v1
with:
ndk-version: r23
- name: Release build
run: |
./build-release
Compress-Archive -CompressionLevel Optimal -Path "jniLibs/arm64-v8a" -DestinationPath "imagemagick-7-android-static.zip"
rm -r jniLibs
./.github-deps/change-to-shared-lib.ps1
./build-release
Compress-Archive -CompressionLevel Optimal -Path "jniLibs/arm64-v8a" -DestinationPath "imagemagick-7-android-shared.zip"
- name: Get latest release
if: github.event_name == 'release'
id: latest_release
uses: kaliber5/action-get-release@v1
with:
token: ${{ github.token }}
latest: true
- name: Update release artifacts
if: github.event_name == 'release'
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: 'imagemagick-7-android-*.zip'
release_id: ${{ steps.latest_release.outputs.id }}
overwrite: true
draft: false
tag_name: ${{ steps.latest_release.outputs.tag_name }}
- name: Get latest release tag
if: github.event_name == 'pull_request'
id: tag
run: |
$dir = Get-ChildItem -Directory -Path "ImageMagick-*" | Select-Object -Last 1
$tag = ($dir | Split-Path -Leaf).Substring(12)
Write-Host "::set-output name=TAG::$tag"
- uses: ncipollo/release-action@v1
if: github.event_name == 'pull_request'
with:
name: Android ImageMagick ${{ steps.tag.outputs.TAG }}
artifacts: 'imagemagick-7-android-*.zip'
body: |
Library built using default config.
If you need a different config than default, please follow compilation instructions on main page to manually build it (or, fork the project, change the config file, and use github actions to build it)
token: ${{ secrets.GITHUB_TOKEN }}
commit: ${{ github.sha }}
tag: ${{ steps.tag.outputs.TAG }}
- name: KMagick Dispatch
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.REPO_SCOPED_TOKEN }}
repository: molotovcherry/kmagick
event-type: new-release
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "tag": "${{ steps.tag.outputs.TAG }}"}'