-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (43 loc) · 1.57 KB
/
update-asset-repopack.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
name: Update Development Release Asset
on:
push:
branches:
- '*' # triggers the workflow on pushes to any branch
jobs:
update-release-asset:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get branch name
id: branch-name
run: echo "::set-output name=branch::${GITHUB_REF#refs/heads/}"
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Run repopack
run: npx repopack --include "**/*.md,**/*.js"
- name: Rename output file
run: mv repopack-output.txt ${{ steps.branch-name.outputs.branch }}-repopack.txt
- name: Get development release
id: get_release
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const release = await github.rest.repos.getReleaseByTag({
owner: 'fogg-lab',
repo: 'gene-platform',
tag: 'dev'
});
return release.data.id;
- name: Update release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: https://uploads.github.com/repos/fogg-lab/gene-platform/releases/${{ steps.get_release.outputs.result }}/assets{?name,label}
asset_path: ./${{ steps.branch-name.outputs.branch }}-repopack.txt
asset_name: ${{ steps.branch-name.outputs.branch }}-repopack.txt
asset_content_type: text/plain