Browse Source

Update builder

pull/3/head
alufers 2 years ago
parent
commit
bcef4326f3
No known key found for this signature in database
GPG Key ID: 9176AE047525A423
  1. 32
      .github/workflows/build.yml
  2. 1
      .gitignore
  3. 1
      inpost_cli.go
  4. 4
      version.go

32
.github/workflows/build.yml

@ -1,11 +1,8 @@
# workflow name
name: Generate release-artifacts
name: Build
# on events
on:
release:
types:
- created
on: [push]
# workflow tasks
jobs:
@ -15,11 +12,22 @@ jobs:
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Generate build files
uses: thatisuday/go-cross-build@v1
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Create build directory
run: |
mkdir -p build
- name: Build for x86_64 linux
run: |
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X 'main.InpostCliVersion=${{ steps.get_version.outputs.VERSION }}'" -o ./build/inpost-cli_linux_x86_64 .
- name: Build for x86_64 windows
run: |
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w -X 'main.InpostCliVersion=${{ steps.get_version.outputs.VERSION }}'" -o ./build/inpost-cli_windows_x86_64.exe .
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
platforms: 'linux/amd64, darwin/amd64, windows/amd64, linux/arm, linux/arm64, android/arm, android/arm64'
package: ''
name: 'inpost-cli'
compress: 'true'
dest: 'dist'
files: build/**
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

1
.gitignore vendored

@ -1 +1,2 @@
inpost-cli
build/

1
inpost_cli.go

@ -80,6 +80,7 @@ func main() {
app := &cli.App{
Usage: "A CLI utility replacing the InPost app",
Description: "This utility allows you to list your packages, generate QR codes in the terminal to collect them and remotely open compartments. \n Warning: There is no limit to how far away you can open the compartments from. Use with caution as you can get your package stolen this way.",
Version: InpostCliVersion,
Commands: []*cli.Command{
LoginCmd,
ListParcelsCmd,

4
version.go

@ -0,0 +1,4 @@
package main
//InpostCliVersion is set by the build system
var InpostCliVersion = "development"
Loading…
Cancel
Save