name: Goon:
push:
branches: [ master ]tags:
- 'v*'# Push events to mathcing v*, i.e. v1.0, v20.15.10jobs:
build:
name: Buildruns-on: ubuntu-lateststeps:
- name: Set up Go 1.xuses: actions/setup-go@v2with:
go-version: ^1.13id: go - name: Check out code into the Go module directoryuses: actions/checkout@v2 - name: Get dependenciesrun: | go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: PreBuild_Linuxrun: mkdir linux_bin - name: Build for Linuxrun: GOOS=linux GOARCH=amd64 go build -v -o stph . - name: PreBuild_Winrun: mkdir windows_bin - name: Build for Windowsrun: GOOS=windows GOARCH=amd64 go build -v -o stph.exe . - name: Create Artifactrun: zip stph.zip -r stph stph.exe configs/sample_settings.yaml templates/stph.html - name: Create Releaseid: create_releaseuses: actions/create-release@v1env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}# This token is provided by Actions, you do not need to create your own tokenwith:
# The name of the tag. This should come from the webhook payload, `github.GITHUB_REF` when a user pushes a new tagtag_name: ${{ github.ref }}# The name of the release. For example, `Release v1.0.1`release_name: Release ${{ github.ref }}# `true` to create a draft (unpublished) release, `false` to create a published one. Default: `false`draft: false# `true` to identify the release as a prerelease. `false` to identify the release as a full release. Default: `false`prerelease: false - name: Upload a Release Assetuses: actions/upload-release-asset@v1.0.2env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}# This token is provided by Actions, you do not need to create your own tokenwith:
# The URL for uploading assets to the releaseupload_url: ${{ steps.create_release.outputs.upload_url }}# The path to the asset you want to uploadasset_path: ./stph.zip# The name of the asset you want to uploadasset_name: stph.zip# The content-type of the asset you want to upload. See the supported Media Types here: https://www.iana.org/assignments/media-types/media-types.xhtml for more informationasset_content_type: application/zip
- name: Create Releaseid: create_releaseuses: actions/create-release@v1env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}# This token is provided by Actions, you do not need to create your own tokenwith:
# The name of the tag. This should come from the webhook payload, `github.GITHUB_REF` when a user pushes a new tagtag_name: ${{ github.ref }}# The name of the release. For example, `Release v1.0.1`release_name: Release ${{ github.ref }}# `true` to create a draft (unpublished) release, `false` to create a published one. Default: `false`draft: false# `true` to identify the release as a prerelease. `false` to identify the release as a full release. Default: `false`prerelease: false
- name: Upload a Release Assetuses: actions/upload-release-asset@v1.0.2env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}# This token is provided by Actions, you do not need to create your own tokenwith:
# The URL for uploading assets to the releaseupload_url: ${{ steps.create_release.outputs.upload_url }}# The path to the asset you want to uploadasset_path: ./stph.zip# The name of the asset you want to uploadasset_name: stph.zip# The content-type of the asset you want to upload. See the supported Media Types here: https://www.iana.org/assignments/media-types/media-types.xhtml for more informationasset_content_type: application/zip
Circle CI等もこういったyaml(ベースの拡張されたもの)でフローを指定すると思うのだが、yamlベースでこういったフローを記入していく形式はソフトが複雑になればなるほどこのファイルも複雑になっていきそうだなと思った。(歴史の長いモノリスなソフトのmakeファイルが大きく複雑になっていく現象と同じ道を辿りそう)