Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V1.2 release action #1621

Merged
merged 4 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release Build
on:
push:
tags:
- "v*.*.*"
- "v*"

jobs:
build:
Expand All @@ -18,21 +18,29 @@ jobs:
echo Current tag: $tag_name
git checkout $tag_name
echo "TAG_NAME=${tag_name}" >> $GITHUB_ENV

- name: Check VERSION consistency
run: |
tag=$(git describe --tags --dirty)
version=$(cat VERSION)
if [ "$tag" != "$version" ]; then
echo "VERSION file is not consistent with tag name"
echo "VERSION: $version"
echo "TAG: $tag"
exit 1
fi

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.18
go-version: "1.21"

- name: Build
- name: Install goreleaser
run: |
make dist
go install github.com/goreleaser/goreleaser@latest

- name: Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.TAG_NAME }}
file: ./build-dir/gop-*.zip
file_glob: true
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WINGET_PKGS_PRIVATE_KEY: ${{ secrets.WINGET_PKGS_PRIVATE_KEY }}
run: goreleaser release -p 4
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ cmd/qfmt/qfmt
bin/
go-num/
_todo*.go

dist/
103 changes: 103 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 1

before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
# - go generate ./...

builds:
- id: gop
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
main: ./cmd/gop
binary: bin/gop
ldflags:
- -X github.com/goplus/gop/env.buildVersion=v{{.Version}}
- -X github.com/goplus/gop/env.buildDate={{.Date}}
- id: gopfmt
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
main: ./cmd/gopfmt
binary: bin/gopfmt
ldflags:
- -X github.com/goplus/gop/env.buildVersion=v{{.Version}}
- -X github.com/goplus/gop/env.buildDate={{.Date}}

archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_v{{.Version}}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip
files:
- LICENSE
- "*.mod"
- "*.sum"
- "*.md"
- "**/*.go"
- "**/*.md"

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"

winget:
- name: gop
homepage: "https://goplus.org/"
publisher: goplus
publisher_url: https://github.com/goplus/gop
publisher_support_url: "https://github.com/goplus/gop/issues/new"
package_identifier: goplus.gop
short_description: The Go+ Programming Language
description: |
The Go+ programming language is designed for engineering, STEM education, and data science.
- For engineering: working in the simplest language that can be mastered by children.
- For STEM education: studying an engineering language that can be used for work in the future.
- For data science: communicating with engineers in the same language.
license: Apache-2.0
skip_upload: false
release_notes: "{{.Changelog}}"
release_notes_url: "https://github.com/goplus/gop/releases/tag/v{{.Version}}"
dependencies:
- package_identifier: GoLang.Go
minimum_version: 1.18.0
repository:
owner: goplus
name: winget-pkgs
branch: "{{.ProjectName}}-v{{.Version}}"
git:
url: "[email protected]:goplus/winget-pkgs.git"
private_key: "{{ .Env.WINGET_PKGS_PRIVATE_KEY }}"
pull_request:
enabled: true
draft: false
base:
owner: microsoft
name: winget-pkgs
branch: master