Skip to content

Commit 42f7db7

Browse files
authored
Fixes for github artifact upload (#103)
* Upgrade npm package upload artifact actions * Update to v4 of actions/upload-artifact * Update code to support changes in latest artifact upload. * Ensure each workflow job has a unique artifact name (Required for v4 artifact upload)
1 parent 0fb8edb commit 42f7db7

File tree

11 files changed

+157431
-13892
lines changed

11 files changed

+157431
-13892
lines changed

.github/workflows/check-dist.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
id: diff
4545

4646
# If index.js was different than expected, upload the expected version as an artifact
47-
- uses: actions/upload-artifact@v3
47+
- uses: actions/upload-artifact@v4
4848
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
4949
with:
5050
name: dist

.github/workflows/test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
uses: ./
2424
with:
2525
uploadLogs: true
26+
artifactName: synapse-logs-${{ github.job }}
2627
httpPort: 8008
2728

2829
test-poetry-branch:
@@ -36,6 +37,7 @@ jobs:
3637
uses: ./
3738
with:
3839
uploadLogs: true
40+
artifactName: synapse-logs-${{ github.job }}
3941
httpPort: 8008
4042
installer: "poetry"
4143
version: "master"
@@ -51,6 +53,7 @@ jobs:
5153
uses: ./
5254
with:
5355
uploadLogs: true
56+
artifactName: synapse-logs-${{ github.job }}
5457
httpPort: 8008
5558
installer: "poetry"
5659

@@ -65,6 +68,7 @@ jobs:
6568
uses: ./
6669
with:
6770
uploadLogs: true
71+
artifactName: synapse-logs-${{ github.job }}
6872
httpPort: 8008
6973
public_baseurl: http://10.0.2.2:8008/
7074

@@ -80,6 +84,7 @@ jobs:
8084
with:
8185
installer: poetry
8286
uploadLogs: true
87+
artifactName: synapse-logs-${{ github.job }}
8388
httpPort: 8008
8489
customModules: "git+https://github.com/michaelkaye/noop-synapse-storage-provider.git"
8590
customConfig: |
@@ -104,6 +109,7 @@ jobs:
104109
uses: ./
105110
with:
106111
uploadLogs: true
112+
artifactName: synapse-logs-${{ github.job }}
107113
httpPort: 8008
108114
customModules: "git+https://github.com/michaelkaye/noop-synapse-storage-provider.git#egg=noop-synapse-storage-provider"
109115
customConfig: |

destroy.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const core = require('@actions/core');
22
const process = require('process');
3-
const artifact = require('@actions/artifact');
3+
const {DefaultArtifactClient} = require('@actions/artifact');
44

55
// most @actions toolkit packages have async methods
66
async function run() {
@@ -26,8 +26,8 @@ async function run() {
2626
// (useful for an artifact upload)
2727
const upload = core.getBooleanInput('uploadLogs', {required: true});
2828
if (upload) {
29+
const artifact = new DefaultArtifactClient();
2930
const artifactName = core.getInput('artifactName');
30-
const artifactClient = artifact.create();
3131
const files = [
3232
`${cwd}/homeserver.yaml`,
3333
`${cwd}/homeserver.log`,
@@ -41,7 +41,7 @@ async function run() {
4141
const options = {
4242
continueOnError: true
4343
}
44-
await artifactClient.uploadArtifact(artifactName, files, rootDirectory, options);
44+
await artifact.uploadArtifact(artifactName, files, rootDirectory, options);
4545
}
4646
} catch (error) {
4747
core.setFailed(error.message);

0 commit comments

Comments
 (0)