Skip to content

more stuff

more stuff #32

Workflow file for this run

name: create release
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.24'
- name: get build tools
run: sudo apt-get -y install build-essential
- name: build
env:
REF: ${{ github.ref }}
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X github.com/msrevive/nexus2/internal/static.Version=${REF:11}" -o build/nexus2_linux_amd64 -v .
- name: compress binary
run: upx build/nexus2_linux_amd64 && chmod +x build/nexus2_linux_amd64
- name: copy runtime directory
run: cp -avr ./runtime/ ./build/
- name: tar release
run: tar -czvf ~/nexus2.tar.gz build
- name: extract changelog
env:
REF: ${{ github.ref }}
run: sed -n "/^## ${REF:10}/,/^## /{/^## /b;p}" CHANGELOG.md > ./RELEASE_CHANGELOG
- name: create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body_path: ./RELEASE_CHANGELOG
draft: true
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') || contains(github.ref, 'rc') }}
- name: upload
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/nexus2.tar.gz
asset_name: nexus2.tar.gz
asset_content_type: application/octet-stream