-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (37 loc) · 1.2 KB
/
create_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
name: Create Release on Master Push
on:
push:
branches:
- main
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Create tar.gz
run: tar -czf airflow-pulsar-plugin.tar.gz -C src airflow_pulsar_plugin
- name: Generate release tag
id: tag
run: |
sha_short=$(git rev-parse --short HEAD)
ts=$(date +"%Y%m%d%H%M%S")
echo "::set-output name=release_tag::release-${ts}-${sha_short}"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag.outputs.release_tag }}
release_name: Release ${{ steps.tag.outputs.release_tag }}
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./airflow-pulsar-plugin.tar.gz
asset_name: airflow-pulsar-plugin-${{ steps.tag.outputs.release_tag }}.tar.gz
asset_content_type: application/gzip