generated from GrafeasGroup/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 2
41 lines (39 loc) · 1.29 KB
/
build_and_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
name: Release
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.10.x'
- name: Install Env
# shiv will download the dependencies it needs on its own
run: |
pip install --upgrade pip
pip install shiv
pip install poetry
pip install git+https://github.com/abersheeran/poetry2setup@master
- name: Add CURRENT_TIME env property
# the smart thing to do here would be to use the commit hash, but
# github releases are ALPHABETIZED, so a commit hash of `abcdef` will
# not be listed as the latest release if `defabc` came before. (╥﹏╥)
run: echo "CURRENT_TIME_VERSION=v$(date '+%s')" >> $GITHUB_ENV
- name: Build the sucker
run: |
sed -i -e "s/?????/${{ env.CURRENT_TIME_VERSION }}/g" bubbles/__init__.py
make build
- uses: ncipollo/release-action@v1
with:
artifacts: "build/bubbles.pyz"
body: "It's releasin' time"
generateReleaseNotes: true
tag: ${{ env.CURRENT_TIME_VERSION }}
commit: main
token: ${{ secrets.GITHUB_TOKEN }}