feat: add snapcraft.yaml for mirrorselect tool #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
env: | |
APP_NAME: 'mirrorselect' | |
DESC: 'Mirrorselect is a tool to help you select the fastest mirror for your system.' | |
GO_VERSION: '1.23' | |
MAINTAINER: 'haukened' | |
jobs: | |
build-artifacts: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Build | |
run: go build -o ${{ env.APP_NAME }} | |
- name: Test | |
run: go test -v ./... | |
- name: Calculate Binary Size | |
id: binary_size | |
run: | | |
echo "BINARY_SIZE=$(stat -c %s './${{ env.APP_NAME }}' | numfmt --to=iec-i --suffix=B)" >> $GITHUB_ENV | |
- name: create deb directories | |
run: | | |
mkdir -p .debpkg/usr/bin | |
cp ${{ env.APP_NAME }} .debpkg/usr/bin/${{ env.APP_NAME }} | |
chmod +x .debpkg/usr/bin/${{ env.APP_NAME }} | |
- uses: jiro4989/build-deb-action@v3 | |
with: | |
package: mirrorselect | |
package_root: .debpkg | |
maintainer: ${{ env.MAINTAINER }} | |
installed_size: ${{ env.BINARY_SIZE }} | |
version: ${{ github.ref_name }} | |
arch: 'amd64' | |
desc: 'Mirrorselect is a tool to help you select the fastest mirror for your system.' | |
homepage: 'https://github.com/haukened/mirrorselect' | |
- uses: actions/upload-artifact@v4 | |
name: Upload deb artifact | |
with: | |
name: ${{ env.APP_NAME }}-linux-amd64-${{ github.ref_name }}.deb | |
path: | | |
./*.deb | |
- uses: actions/upload-artifact@v4 | |
name: Upload build artifact | |
with: | |
name: ${{ env.APP_NAME }}-linux-amd64 | |
path: | | |
./${{ env.APP_NAME }} |