-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (73 loc) · 2.26 KB
/
test-release.yaml
File metadata and controls
80 lines (73 loc) · 2.26 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
name: Test Release API
on:
workflow_call:
inputs:
branch:
type: string
required: true
description: The name of the branch
outputs:
release-id:
value: ${{ jobs.create.outputs.release-id }}
description: The created release ID
release-tag:
value: ${{ jobs.create.outputs.release-tag }}
description: The created release tag
jobs:
create:
name: Create
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
release-id: ${{ steps.create.outputs.release-id }}
release-tag: ${{ steps.create.outputs.release-tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create release
id: create
uses: ./releases/create
with:
name: "Workflow run ${{ github.run_id }}"
body: |
This is a test Github release initiated by [this workflow](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}).
Please ignore this
tag-name: test-${{ github.run_id }}
target-commitish: ${{ inputs.branch }}
test-assets:
name: Assets
needs: [create]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create artifacts
run: |
mkdir -p artifacts
echo "Hello world" >> artifacts/greeting.txt
cp docs/osi-approved-300x350.png artifacts/image.png
- name: Attach greeting.txt to release
id: greeting
uses: ./releases/upload-asset
with:
release-id: ${{ needs.create.outputs.release-id }}
path: artifacts/greeting.txt
name: greeting.txt
- name: Attach image to release
id: image
uses: ./releases/upload-asset
with:
release-id: ${{ needs.create.outputs.release-id }}
path: artifacts/image.png
name: image.png
- name: Remove greeting.txt from release
uses: ./releases/delete-asset
with:
asset-id: ${{ steps.greeting.outputs.asset-id }}
- name: Attach image to release
uses: ./releases/delete-asset
with:
asset-id: ${{ steps.image.outputs.asset-id }}