This repository was archived by the owner on May 25, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 11
155 lines (136 loc) · 5.8 KB
/
publish_release.yml
File metadata and controls
155 lines (136 loc) · 5.8 KB
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
name: "(R) |α| Publish Release"
on:
workflow_call:
inputs:
win_runtime_artifact_workflow_call:
type: string
required: false
default: ""
linux_runtime_artifact_workflow_call:
type: string
required: false
default: ""
mac_runtime_artifact_workflow_call:
type: string
required: false
default: ""
permissions:
contents: write
run-name: "|α| Publish Release"
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: init zx
run: |
deno install -g -A npm:zx
- uses: actions/checkout@v4
- name: Retrieve run IDs
run: |
if [ -z "${{ inputs.win_runtime_artifact_workflow_call }}" ]; then
WINDOWS_ID=$(curl -s \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/Floorp-Projects/Floorp/actions/workflows/package.yml/runs?branch=main&status=success" \
| jq -r '[.workflow_runs[] | select(.display_title | endswith("Windows-x64"))][0].id')
echo "WINDOWS_RUN_ID=$WINDOWS_ID" >> $GITHUB_ENV
else
echo "WINDOWS_RUN_ID=${{ inputs.win_runtime_artifact_workflow_call }}" >> $GITHUB_ENV
fi
if [ -z "${{ inputs.linux_runtime_artifact_workflow_call }}" ]; then
LINUX_ID=$(curl -s \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/Floorp-Projects/Floorp/actions/workflows/package.yml/runs?branch=main&status=success" \
| jq -r '[.workflow_runs[] | select(.display_title | endswith("Linux-x64"))][0].id')
echo "LINUX_RUN_ID=$LINUX_ID" >> $GITHUB_ENV
else
echo "LINUX_RUN_ID=${{ inputs.linux_runtime_artifact_workflow_call }}" >> $GITHUB_ENV
fi
if [ -z "${{ inputs.mac_runtime_artifact_workflow_call }}" ]; then
MAC_ID=$(curl -s \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/Floorp-Projects/Floorp/actions/workflows/package.yml/runs?branch=main&status=success" \
| jq -r '[.workflow_runs[] | select(.display_title | endswith("macOS-x64"))][0].id')
echo "MAC_RUN_ID=$MAC_ID" >> $GITHUB_ENV
else
echo "MAC_RUN_ID=${{ inputs.mac_runtime_artifact_workflow_call }}" >> $GITHUB_ENV
fi
- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: noraneko-win-amd64-mar-full
run-id: ${{ env.WINDOWS_RUN_ID }}
path: ~/noraneko-publish/win
github-token: ${{ github.token }}
- name: Download Linux artifact
uses: actions/download-artifact@v4
with:
name: noraneko-linux-amd64-mar-full
run-id: ${{ env.LINUX_RUN_ID }}
path: ~/noraneko-publish/linux
github-token: ${{ github.token }}
- name: Download macOS artifact
uses: actions/download-artifact@v4
with:
name: noraneko-mac-universal-mar-full
run-id: ${{ env.MAC_RUN_ID }}
path: ~/noraneko-publish/mac
github-token: ${{ github.token }}
- name: Download Windows installer
uses: actions/download-artifact@v4
with:
name: noraneko-win-amd64-installer
run-id: ${{ env.WINDOWS_RUN_ID }}
path: ~/noraneko-publish/win-dist
github-token: ${{ github.token }}
- name: Download Linux installer
uses: actions/download-artifact@v4
with:
name: noraneko-linux-amd64-installer
run-id: ${{ env.LINUX_RUN_ID }}
path: ~/noraneko-publish/linux-dist
github-token: ${{ github.token }}
- name: Download macOS installer
uses: actions/download-artifact@v4
with:
name: noraneko-mac-universal-installer
run-id: ${{ env.MAC_RUN_ID }}
path: ~/noraneko-publish/mac-dist
github-token: ${{ github.token }}
- name: Setup
run: |
deno install --allow-scripts
sudo apt install jq
echo "VERSION=$(cat ~/noraneko-publish/win/meta.json | jq '.version' | sed 's/\"//g')" >> "$GITHUB_ENV"
echo "NR_VERSION=$(cat ~/noraneko-publish/win/meta.json | jq '.noraneko_version' | sed 's/\"//g')" >> "$GITHUB_ENV"
echo "ROOT_DIR=$(echo ~)" >> "$GITHUB_ENV"
- name: Deploy to GitHub Releases 🚀
uses: softprops/action-gh-release@v2
with:
files: |
${{ env.ROOT_DIR }}/noraneko-publish/win/*.mar
${{ env.ROOT_DIR }}/noraneko-publish/win/*.xml
${{ env.ROOT_DIR }}/noraneko-publish/win-dist/*.exe
${{ env.ROOT_DIR }}/noraneko-publish/linux/*.mar
${{ env.ROOT_DIR }}/noraneko-publish/linux/*.xml
${{ env.ROOT_DIR }}/noraneko-publish/linux-dist/**
${{ env.ROOT_DIR }}/noraneko-publish/mac/*.mar
${{ env.ROOT_DIR }}/noraneko-publish/mac/*.xml
${{ env.ROOT_DIR }}/noraneko-publish/mac-dist/*.dmg
tag_name: "v${{ env.VERSION }}"
name: "Floorp 12 ${env.VERSION}"
body: "Release Note: \n\n https://blog.floorp.app/release/${{ env.VERSION }}"
draft: false
make_latest: true
token: ${{ github.token }}