Skip to content

Commit 8b415db

Browse files
committed
ci(actions): update s3 path for app
1 parent e81715f commit 8b415db

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

.github/workflows/release.yaml

+14-16
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ jobs:
3636
- name: List artifacts
3737
id: list-artifacts
3838
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)
4040
echo "app-artifacts=${app_artifacts}" >> "$GITHUB_OUTPUT"
41+
4142
endpoint_artifacts=$(aws s3api list-objects --bucket aorta-chelpis --prefix build/aorta-endpoint-installer/pqtunnel-endpoint-v${{github.event.inputs.endpoint-version}} | jq -c)
4243
echo "endpoint-artifacts=${endpoint_artifacts}" >> "$GITHUB_OUTPUT"
4344
@@ -46,30 +47,27 @@ jobs:
4647
uses: actions/github-script@v6
4748
with:
4849
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);
5957
if (match && match[1] && !match[1].includes("-dev-") && !match[1].includes("-alpha-") && !match[1].includes("-beta-")) {
6058
return [
6159
{
62-
name: `${prefix}-${match[1]}`,
60+
bucket: "aorta-chelpis",
61+
name: `pqtunnel-endpoint-${match[1]}`,
6362
key: Key,
6463
},
6564
];
6665
}
6766
return [];
6867
});
68+
6969
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),
7371
});
7472
7573
publish-release:
@@ -94,7 +92,7 @@ jobs:
9492
- name: Download artifact
9593
run: |
9694
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 }}
9896
9997
- name: Upload Release
10098
uses: softprops/action-gh-release@v1

0 commit comments

Comments
 (0)