1+ name : artifacts release
2+
3+ on :
4+ push :
5+ tags :
6+ - ' *'
7+
8+ jobs :
9+ build :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : checkout repo content
13+ uses : actions/checkout@v2 # checkout the repository content
14+
15+ - name : setup python
16+ uses : actions/setup-python@v4
17+ with :
18+ python-version : ' 3.10' # install the python version needed
19+
20+ - name : install python packages
21+ run : |
22+ cd artifact_builder
23+ python -m pip install --upgrade pip
24+ pip install -r requirements.txt
25+
26+ - name : execute artifact_builder
27+ run : python artifact_builder -D sql -O index.json
28+
29+ - name : Extract tag name
30+ id : tag
31+ uses : actions/github-script@0.2.0
32+ with :
33+ github-token : ${{ secrets.GITHUB_TOKEN }}
34+ script : |
35+ return context.payload.ref.replace(/\/refs\/tags\//, '');
36+
37+ # # In the future, we may want to release on main branch
38+ # # and place the version in a file, so it automatically
39+ # # creates the release and tag.
40+ # - name: version
41+ # run: echo "::set-output name=version::$(./bin/azblogfilter --version)"
42+ # id: tag
43+ # - name: release
44+ # uses: actions/create-release@v1
45+ # id: create_release
46+ # with:
47+ # draft: false
48+ # prerelease: false
49+ # release_name: ${{ steps.tag.outputs.version }}
50+ # tag_name: ${{ github.ref }}
51+ # body_path: CHANGELOG.md
52+ # env:
53+ # GITHUB_TOKEN: ${{ github.token }}
54+
55+ - name : Gets the latest created release info
56+ id : latest_release_info
57+ uses : jossef/action-latest-release-info@v1.2.1
58+ env :
59+ GITHUB_TOKEN : ${{ github.token }}
60+
61+ - name : upload artifact
62+ uses : actions/upload-release-asset@v1
63+ env :
64+ GITHUB_TOKEN : ${{ github.token }}
65+ with :
66+ upload_url : ${{ steps.latest_release_info.outputs.upload_url }}
67+ asset_path : index.json
68+ asset_name : index.json
69+ asset_content_type : application/json
0 commit comments