-
Notifications
You must be signed in to change notification settings - Fork 5
115 lines (101 loc) · 3.76 KB
/
testosswsl.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Build And Release on openSUSE WSL
on:
workflow_dispatch:
inputs:
revision:
description: 'Revision'
required: false
default: ''
repository_dispatch:
inputs:
revision:
description: 'Revision'
required: false
default: ''
jobs:
build:
name: Build
needs: create_release
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Build
id: build
shell: cmd
run: osssetup.bat
- name: prepare
id: prep
shell: bash
run: |
echo "zip_path=$(cygpath -w -a vice/gtk3vice*.sh)" >> $GITHUB_OUTPUT
echo "zip_name=$(basename vice/gtk3vice*.sh)" >> $GITHUB_OUTPUT
echo "upd_path=$(cygpath -w -a vice/vice_update.sh)" >> $GITHUB_OUTPUT
echo "upd_name=$(basename vice/vice_update.sh)" >> $GITHUB_OUTPUT
- name: Upload Release
id: upload
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ${{ steps.prep.outputs.zip_path }}
asset_name: ${{ steps.prep.outputs.zip_name }}
asset_content_type: application/x-7z-compressed
- name: Upload Release 2
id: upload2
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ${{ steps.prep.outputs.upd_path }}
asset_name: ${{ steps.prep.outputs.upd_name }}
asset_content_type: application/x-7z-compressed
create_release:
name: Prepare Release
runs-on: windows-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
release_id: ${{ steps.create_release.outputs.id }}
steps:
- name: Get revision
shell: bash
run: |
echo "revision=$(svn info --show-item last-changed-revision svn://svn.code.sf.net/p/vice-emu/code/trunk/vice@${{ github.event.inputs.revision }})" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.WF }}
with:
tag_name: r${{ env.revision }}o
release_name: r${{ env.revision }} OpenSUSE TumbleWeed
draft: true
prerelease: true
publish_release:
name: Publish Release
needs: [create_release, build]
runs-on: windows-latest
steps:
- name: Get revision
shell: bash
run: |
echo -e '### Changelog:\n\n```text' >revbody.txt
svn log -l 5 svn://svn.code.sf.net/p/vice-emu/code/trunk/vice@${{ env.revision }} | sed -e '2,$!d' >>revbody.txt
echo -e '```' >>revbody.txt
for a in $(curl -qs https://api.github.com/repos/$GITHUB_REPOSITORY/actions/workflows/testosswsl.yml/runs|grep -B 1 "Build And Release"|grep id|tr -d " ,"|cut -d ":" -f 2);do curl -qs -X DELETE -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.WF }} " "https://api.github.com/repos/$GITHUB_REPOSITORY/actions/runs/$a";done
- uses: actions/github-script@v3
with:
github-token: ${{secrets.WF}} # ${{secrets.GITHUB_TOKEN}}
script: |
fs=require("fs");
github.repos.updateRelease(
{
owner: context.repo.owner,
repo: context.repo.repo,
body: fs.readFileSync('revbody.txt', 'utf8').toString(),
release_id: ${{ needs.create_release.outputs.release_id }},
draft: false,
prerelease: false,
release: true
});