mirror of
https://github.com/pterodactyl/wings.git
synced 2026-04-12 07:06:20 -05:00
57 lines
2.0 KiB
YAML
57 lines
2.0 KiB
YAML
name: Release
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
jobs:
|
|
release:
|
|
name: Release
|
|
runs-on: ubuntu-24.04
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Code checkout
|
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
|
with:
|
|
go-version: 1.24.11
|
|
|
|
- name: Build release binaries
|
|
env:
|
|
CGO_ENABLED: 0
|
|
run: |
|
|
GOARCH=amd64 go build -o dist/wings_linux_amd64 -v -trimpath -ldflags="-s -w -X github.com/pterodactyl/wings/system.Version=${{ github.ref_name }}" github.com/pterodactyl/wings
|
|
chmod 755 dist/wings_linux_amd64
|
|
GOARCH=arm64 go build -o dist/wings_linux_arm64 -v -trimpath -ldflags="-s -w -X github.com/pterodactyl/wings/system.Version=${{ github.ref_name }}" github.com/pterodactyl/wings
|
|
chmod 755 dist/wings_linux_arm64
|
|
|
|
- name: Create release branch
|
|
env:
|
|
VERSION: ${{ github.ref_name }}
|
|
run: |
|
|
BRANCH=release/${{ env.VERSION }}
|
|
git config --local user.email "ci@pterodactyl.io"
|
|
git config --local user.name "Pterodactyl CI"
|
|
git checkout -b $BRANCH
|
|
git push -u origin $BRANCH
|
|
sed -i "s/var Version = \".*\"/var Version = \"${VERSION:1}\"/" system/const.go
|
|
git add system/const.go
|
|
git commit -m "ci(release): bump version"
|
|
git push
|
|
|
|
- name: write changelog
|
|
run: |
|
|
sed -n "/^## ${{ github.ref_name }}/,/^## /{/^## /b;p}" CHANGELOG.md > ./RELEASE_CHANGELOG
|
|
|
|
- uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
draft: true
|
|
prerelease: ${{ contains(github.ref_name, 'rc') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'alpha') }}
|
|
body_path: ./RELEASE_CHANGELOG
|
|
files: |
|
|
dist/*
|