Skip to content

Commit c29dcee

Browse files
committed
feat: add GH actions
Signed-off-by: Emanuel Calvo <3manuek@gmail.com>
1 parent b05c713 commit c29dcee

File tree

3 files changed

+108
-0
lines changed

3 files changed

+108
-0
lines changed

.github/workflows/main.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: artifacts build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: checkout repo content
13+
uses: actions/checkout@v2
14+
15+
- name: setup python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: '3.10'
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+

.github/workflows/release.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Changelog
2+
3+
Notable changes to pgqueries.
4+
5+
## Release number - [yyyy-mm-dd]
6+
7+
### Added
8+
9+
### Changed
10+
11+
### Fixed

0 commit comments

Comments
 (0)