36
36
- name : List artifacts
37
37
id : list-artifacts
38
38
run : |
39
- app_artifacts=$(aws s3api list-objects --bucket aorta-chelpis --prefix build/aorta -app-installer/pq-tunnel-installer- ${{github.event.inputs.app-version}} | jq -c)
39
+ app_artifacts=$(aws s3api list-objects --bucket pqtunnel --prefix release/pqtunnel -app/v ${{github.event.inputs.app-version}}/ | jq -c)
40
40
echo "app-artifacts=${app_artifacts}" >> "$GITHUB_OUTPUT"
41
+
41
42
endpoint_artifacts=$(aws s3api list-objects --bucket aorta-chelpis --prefix build/aorta-endpoint-installer/pqtunnel-endpoint-v${{github.event.inputs.endpoint-version}} | jq -c)
42
43
echo "endpoint-artifacts=${endpoint_artifacts}" >> "$GITHUB_OUTPUT"
43
44
@@ -46,30 +47,27 @@ jobs:
46
47
uses : actions/github-script@v6
47
48
with :
48
49
script : |
49
- const APP_NAME = "pqtunnel-app";
50
- const APP_KEY_REGEX = /^build\/aorta-app-installer\/pq-tunnel-installer-(.*)$/;
51
- const ENDPOINT_NAME = "pqtunnel-endpoint";
52
- const ENDPOINT_KEY_REGEX =
53
- /^build\/aorta-endpoint-installer\/pqtunnel-endpoint-v(.*)$/;
54
- const appArtifacts = ${{ steps.list-artifacts.outputs.app-artifacts }};
55
- const endpointArtifacts = ${{ steps.list-artifacts.outputs.endpoint-artifacts }};
56
- const processArtifact = (artifacts, prefix, regex) =>
57
- artifacts.Contents.flatMap(({ Key }) => {
58
- const match = regex.exec(Key);
50
+ const path = require("path");
51
+
52
+ const appArtifacts = (${{ steps.list-artifacts.outputs.app-artifacts }})
53
+ .Contents.map(({Key}) => ({ bucket: "pqtunnel", name: path.basename(Key), key: Key }));
54
+ const endpointArtifacts = (${{ steps.list-artifacts.outputs.endpoint-artifacts }})
55
+ .Contents.flatMap(({ Key }) => {
56
+ const match = /^build\/aorta-endpoint-installer\/pqtunnel-endpoint-v(.*)$/.exec(Key);
59
57
if (match && match[1] && !match[1].includes("-dev-") && !match[1].includes("-alpha-") && !match[1].includes("-beta-")) {
60
58
return [
61
59
{
62
- name: `${prefix}-${match[1]}`,
60
+ bucket: "aorta-chelpis",
61
+ name: `pqtunnel-endpoint-${match[1]}`,
63
62
key: Key,
64
63
},
65
64
];
66
65
}
67
66
return [];
68
67
});
68
+
69
69
core.setOutput("matrix", {
70
- include: processArtifact(appArtifacts, APP_NAME, APP_KEY_REGEX).concat(
71
- processArtifact(endpointArtifacts, ENDPOINT_NAME, ENDPOINT_KEY_REGEX),
72
- ),
70
+ include: appArtifacts.concat(endpointArtifacts),
73
71
});
74
72
75
73
publish-release :
94
92
- name : Download artifact
95
93
run : |
96
94
echo "⬇️ Downloading ${{ matrix.name }}"
97
- aws s3api get-object --bucket aorta-chelpis --key ${{ matrix.key }} ${{ matrix.name }}
95
+ aws s3api get-object --bucket ${{ matrix.bucket }} --key ${{ matrix.key }} ${{ matrix.name }}
98
96
99
97
- name : Upload Release
100
98
uses : softprops/action-gh-release@v1
0 commit comments