-
-
Notifications
You must be signed in to change notification settings - Fork 256
83 lines (78 loc) · 2.35 KB
/
release.yaml
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Release drafter
on: workflow_dispatch
permissions:
contents: read
jobs:
draft_release:
runs-on: ubuntu-latest
outputs:
tag_name: ${{ steps.release.outputs.tag_name }}
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Read version
id: read_version
run: |
echo "version=$(cat version/VERSION | tr -d '[:space:]')" >> $GITHUB_OUTPUT
- name: Print version
run: |
echo ${{ steps.read_version.outputs.version }}
- uses: release-drafter/release-drafter@v5
id: release
with:
config-name: release-template.yaml
version: ${{ steps.read_version.outputs.version }}
latest: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_and_publish:
runs-on: ubuntu-latest
needs: draft_release
name: Release linux/amd64
permissions:
contents: write
pull-requests: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: ${{ needs.draft_release.outputs.tag_name }}
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.21
- name: Display Go version
run: go version
- name: Build linux/amd64
env:
GOOS: darwin
GOARCH: amd64
run: |
go build -ldflags="-w -s" github.com/xvzc/SpoofDPI/cmd/spoof-dpi
tar -zcvf "spoof-dpi-$GOOS-$GOARCH.tar.gz" ./spoof-dpi && rm -rf ./spoof-dpi
gh release list --json name
gh --version
# gh release upload $TAG_NAME "./spoof-dpi-$GOOS-$GOARCH.tar.gz"
# build_and_publish:
# needs: draft_release
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Set up Python 3.10
# uses: actions/setup-python@v3
# with:
# python-version: "3.10"
# - name: Initialize build environment
# run: |
# python -m pip install -r requirements.txt
# - name: Build pakage
# env:
# BOJ_CLI_NEXT_VERSION: ${{ needs.draft_release.outputs.tag_name }}
# run: |
# python setup.py sdist bdist_wheel
# - name: Publish to pypi
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.PYPI_API_TOKEN }}