Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add release workflow #26

Merged
merged 4 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: release

on:
release:
type: [created]

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: 1.21
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Get dependencies
run:
sudo apt update && sudo apt install -y debhelper

- name: Set env
run: echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV

- name: build package
run: |
make package
gh release upload ${TAG} $(echo ../* | tr ' ' '\n' | grep -v '^../yproxy$' | tr '\n' ' ')
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ build:
unittest:
go test -race ./pkg/message/...

version = $(shell git describe --tags --abbrev=0)
package:
sed -i 's/YPROXY_VERSION/${version}/g' debian/changelog
dpkg-buildpackage -us -uc