Update app version #115
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 Go Project and Create Release | |
on: | |
push: | |
branches: [release] | |
permissions: | |
contents: write | |
jobs: | |
build_and_release: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: "1.20.x" | |
- name: Linux | |
if: matrix.os == 'ubuntu-20.04' | |
run: | | |
go build -ldflags="-s -w" -o tgpt-linux-amd64 | |
GOARCH=386 go build -ldflags="-s -w" -o tgpt-linux-i386 | |
GOARCH=arm64 go build -ldflags="-s -w" -o tgpt-linux-arm64 | |
GOARCH=arm go build -ldflags="-s -w" -o tgpt-linux-arm | |
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o tgpt-amd64.exe | |
GOOS=windows GOARCH=arm go build -ldflags="-s -w" -o tgpt-arm.exe | |
GOOS=windows GOARCH=arm64 go build -ldflags="-s -w" -o tgpt-arm64.exe | |
GOOS=windows GOARCH=386 go build -ldflags="-s -w" -o tgpt-i386.exe | |
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o tgpt-mac-amd64 | |
GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o tgpt-mac-arm64 | |
GOOS=netbsd GOARCH=amd64 go build -ldflags="-s -w" -o tgpt-netbsd-amd64 | |
GOOS=netbsd GOARCH=arm64 go build -ldflags="-s -w" -o tgpt-netbsd-arm64 | |
GOOS=netbsd GOARCH=arm go build -ldflags="-s -w" -o tgpt-netbsd-arm | |
GOOS=netbsd GOARCH=386 go build -ldflags="-s -w" -o tgpt-netbsd-i386 | |
GOOS=freebsd GOARCH=amd64 go build -ldflags="-s -w" -o tgpt-freebsd-amd64 | |
GOOS=freebsd GOARCH=arm64 go build -ldflags="-s -w" -o tgpt-freebsd-arm64 | |
GOOS=freebsd GOARCH=arm go build -ldflags="-s -w" -o tgpt-freebsd-arm | |
GOOS=freebsd GOARCH=386 go build -ldflags="-s -w" -o tgpt-freebsd-i386 | |
echo "## Changelog:" >> ${{ github.workspace }}-CHANGELOG.txt | |
echo "<details><summary>SHA256 Hashes</summary><code>" >> ${{ github.workspace }}-CHANGELOG.txt | |
echo "SHA256 hashes of the built binaries:" | |
echo "SHA256 hashes of the built binaries:" >> ${{ github.workspace }}-CHANGELOG.txt | |
sha256sum tgpt-linux-amd64 | |
sha256sum tgpt-linux-amd64 >> ${{ github.workspace }}-CHANGELOG.txt | |
sha256sum tgpt-linux-i386 | |
sha256sum tgpt-linux-i386 >> ${{ github.workspace }}-CHANGELOG.txt | |
sha256sum tgpt-linux-arm64 | |
sha256sum tgpt-linux-arm64 >> ${{ github.workspace }}-CHANGELOG.txt | |
sha256sum tgpt-amd64.exe | |
sha256sum tgpt-amd64.exe >> ${{ github.workspace }}-CHANGELOG.txt | |
sha256sum tgpt-i386.exe | |
sha256sum tgpt-i386.exe >> ${{ github.workspace }}-CHANGELOG.txt | |
sha256sum tgpt-mac-amd64 | |
sha256sum tgpt-mac-amd64 >> ${{ github.workspace }}-CHANGELOG.txt | |
sha256sum tgpt-mac-arm64 | |
sha256sum tgpt-mac-arm64 >> ${{ github.workspace }}-CHANGELOG.txt | |
echo "</code></details>" >> ${{ github.workspace }}-CHANGELOG.txt | |
- name: Upload Artifacts | |
id: upload-artifacts | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
tgpt-linux-amd64 | |
tgpt-linux-i386 | |
tgpt-linux-arm64 | |
tgpt-linux-arm | |
tgpt-amd64.exe | |
tgpt-i386.exe | |
tgpt-arm.exe | |
tgpt-arm64.exe | |
tgpt-mac-amd64 | |
tgpt-mac-arm64 | |
tgpt-netbsd-amd64 | |
tgpt-netbsd-arm64 | |
tgpt-netbsd-arm | |
tgpt-netbsd-i386 | |
tgpt-freebsd-amd64 | |
tgpt-freebsd-arm64 | |
tgpt-freebsd-arm | |
tgpt-freebsd-i386 | |
tgpt-openbsd-amd64 | |
tgpt-openbsd-arm64 | |
tgpt-openbsd-arm | |
tgpt-openbsd-i386 | |
token: ${{ secrets.GITHUB_TOKEN }} | |
draft: true | |
tag_name: v | |
name: tgpt | |
body_path: ${{ github.workspace }}-CHANGELOG.txt | |
# - name: Install Snapcraft | |
# run: | | |
# sudo apt update | |
# sudo apt install snapd jq | |
# sudo snap install core | |
# sudo snap install snapcraft --classic | |
# - name: Build Snap package | |
# run: | | |
# snapcraft init | |
# echo "name: Terminal GPT" >> snap/snapcraft.yaml | |
# echo "version: $(jq ".version" < version.txt')" >> snap/snapcraft.yaml | |
# echo "summary: CLI tool for ChatGPT 3.5" >> snap/snapcraft.yaml | |
# echo "description: |" >> snap/snapcraft.yaml | |
# echo " gpt is a cross-platform command-line interface (CLI) tool that allows you to" >> snap/snapcraft.yaml | |
# echo " use ChatGPT 3.5 in your Terminal without requiring API keys." >> snap/snapcraft.yaml | |
# echo "confinement: strict" >> snap/snapcraft.yaml | |
# echo "parts:" >> snap/snapcraft.yaml | |
# echo " tgpt:" >> snap/snapcraft.yaml | |
# echo " plugin: go" >> snap/snapcraft.yaml | |
# echo " source: https://raw.githubusercontent.com/aandrew-me/tgpt/main/install" >> snap/snapcraft.yaml | |
# echo "apps:" >> snap/snapcraft.yaml | |
# echo " tgpt:" >> snap/snapcraft.yaml | |
# echo " command: tgpt" >> snap/snapcraft.yaml | |
# echo " plugs: [home, network, network-bind]" >> snap/snapcraft.yaml | |
# snapcraft | |
# - name: Publish to Snap Store | |
# env: | |
# SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }} | |
# run: | | |
# snapcraft push --release=edge *.snap |