-
Notifications
You must be signed in to change notification settings - Fork 348
57 lines (55 loc) · 2.37 KB
/
update-crossc2kit-release.yml
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
on:
push:
branches:
- cs4.1
paths:
- 'CrossC2Kit/**'
- '!CrossC2Kit/README.md'
name: Update CrossC2Kit Release
jobs:
build:
name: Update Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Build project # This would actually build your project, using zip for an example artifact
run: |
zip -r CrossC2Kit-${{ steps.date.outputs.date }} CrossC2Kit/
echo 1 > blank
- name: Gets latest created release info
id: latest_release_info
uses: jossef/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Create a placeholder file
id: create-placeholder-file
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.latest_release_info.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./blank
asset_name: placeholder
asset_content_type: application/zip
- name: Delete old release assets
uses: mknejp/delete-release-assets@v1
with:
token: ${{ github.token }}
tag: ${{ steps.latest_release_info.outputs.tag_name }}
assets: |
CrossC2Kit-GithubBot-*.zip
placeholder
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.latest_release_info.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./CrossC2Kit-${{ steps.date.outputs.date }}.zip
asset_name: CrossC2Kit-GithubBot-${{ steps.date.outputs.date }}.zip
asset_content_type: application/zip