name: Release # This workflow is triggered manually on: workflow_dispatch: inputs: version_bump_type: description: 'Version Bump Type (major, minor, patch)' required: true default: 'patch' version_metadata_path: description: 'Path to file containing Version string' required: true default: 'webapp/backend/pkg/version/version.go' jobs: build: name: Build runs-on: ubuntu-latest container: karalabe/xgo-1.13.x env: PROJECT_PATH: /go/src/github.com/analogj/scrutiny CGO_ENABLED: 1 steps: - name: Git run: | apt-get update && apt-get install -y software-properties-common add-apt-repository ppa:git-core/ppa && apt-get update && apt-get install -y git git --version - name: Checkout uses: actions/checkout@v2 with: fetch-depth: 0 - name: Bump version id: bump_version uses: packagrio/action-bumpr-go@master with: version_bump_type: ${{ github.event.inputs.version_bump_type }} version_metadata_path: ${{ github.event.inputs.version_metadata_path }} env: GITHUB_TOKEN: ${{ secrets.SCRUTINY_GITHUB_TOKEN }} # Leave this line unchanged - name: Test run: | mkdir -p $(dirname "$PROJECT_PATH") cp -a $GITHUB_WORKSPACE $PROJECT_PATH cd $PROJECT_PATH go mod vendor go test -v -tags "static" $(go list ./... | grep -v /vendor/) - name: Build Binaries run: | cd $PROJECT_PATH make all # restore modified dir to GH workspace. cp -arf $PROJECT_PATH/. $GITHUB_WORKSPACE/ - name: Commit Changes id: commit uses: packagrio/action-releasr-go@master env: # This is necessary in order to push a commit to the repo GITHUB_TOKEN: ${{ secrets.SCRUTINY_GITHUB_TOKEN }} # Leave this line unchanged with: version_metadata_path: ${{ github.event.inputs.version_metadata_path }} - name: Publish Release id: publish uses: packagrio/action-publishr-go@master env: # This is necessary in order to push a commit to the repo GITHUB_TOKEN: ${{ secrets.SCRUTINY_GITHUB_TOKEN }} # Leave this line unchanged with: upload_assets: '/build/scrutiny-web-linux-amd64 /build/scrutiny-collector-metrics-linux-amd64 /build/scrutiny-web-linux-arm64 /build/scrutiny-collector-metrics-linux-arm64 /build/scrutiny-web-linux-arm-5 /build/scrutiny-collector-metrics-linux-arm-5 /build/scrutiny-web-linux-arm-6 /build/scrutiny-collector-metrics-linux-arm-6 /build/scrutiny-web-linux-arm-7 /build/scrutiny-collector-metrics-linux-arm-7' # - name: Release Asset - Web - linux-amd64 # id: upload-release-asset1 # uses: actions/upload-release-asset@v1 # env: # GITHUB_TOKEN: ${{ secrets.SCRUTINY_GITHUB_TOKEN }} # with: # upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps # asset_path: /build/scrutiny-web-linux-amd64 # asset_name: scrutiny-web-linux-amd64 # asset_content_type: application/octet-stream # - name: Release Asset - Collector - linux-amd64 # id: upload-release-asset2 # uses: actions/upload-release-asset@v1 # env: # GITHUB_TOKEN: ${{ secrets.SCRUTINY_GITHUB_TOKEN }} # with: # upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps # asset_path: /build/scrutiny-collector-metrics-linux-amd64 # asset_name: scrutiny-collector-metrics-linux-amd64 # asset_content_type: application/octet-stream # - name: Release Asset - Web - linux-arm64 # id: upload-release-asset3 # uses: actions/upload-release-asset@v1 # env: # GITHUB_TOKEN: ${{ secrets.SCRUTINY_GITHUB_TOKEN }} # with: # upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps # asset_path: /build/scrutiny-web-linux-arm64 # asset_name: scrutiny-web-linux-arm64 # asset_content_type: application/octet-stream # - name: Release Asset - Collector - linux-arm64 # id: upload-release-asset4 # uses: actions/upload-release-asset@v1 # env: # GITHUB_TOKEN: ${{ secrets.SCRUTINY_GITHUB_TOKEN }} # with: # upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps # asset_path: /build/scrutiny-collector-metrics-linux-arm64 # asset_name: scrutiny-collector-metrics-linux-arm64 # asset_content_type: application/octet-stream # - name: Release Asset - Web - linux-arm-5 # id: upload-release-asset5 # uses: actions/upload-release-asset@v1 # env: # GITHUB_TOKEN: ${{ secrets.SCRUTINY_GITHUB_TOKEN }} # with: # upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps # asset_path: /build/scrutiny-web-linux-arm-5 # asset_name: scrutiny-web-linux-arm-5 # asset_content_type: application/octet-stream # - name: Release Asset - Collector - linux-arm-5 # id: upload-release-asset6 # uses: actions/upload-release-asset@v1 # env: # GITHUB_TOKEN: ${{ secrets.SCRUTINY_GITHUB_TOKEN }} # with: # upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps # asset_path: /build/scrutiny-collector-metrics-linux-arm-5 # asset_name: scrutiny-collector-metrics-linux-arm-5 # asset_content_type: application/octet-stream # - name: Release Asset - Web - linux-arm-6 # id: upload-release-asset7 # uses: actions/upload-release-asset@v1 # env: # GITHUB_TOKEN: ${{ secrets.SCRUTINY_GITHUB_TOKEN }} # with: # upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps # asset_path: /build/scrutiny-web-linux-arm-6 # asset_name: scrutiny-web-linux-arm-6 # asset_content_type: application/octet-stream # - name: Release Asset - Collector - linux-arm-6 # id: upload-release-asset8 # uses: actions/upload-release-asset@v1 # env: # GITHUB_TOKEN: ${{ secrets.SCRUTINY_GITHUB_TOKEN }} # with: # upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps # asset_path: /build/scrutiny-collector-metrics-linux-arm-6 # asset_name: scrutiny-collector-metrics-linux-arm-6 # asset_content_type: application/octet-stream # - name: Release Asset - Web - linux-arm-7 # id: upload-release-asset9 # uses: actions/upload-release-asset@v1 # env: # GITHUB_TOKEN: ${{ secrets.SCRUTINY_GITHUB_TOKEN }} # with: # upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps # asset_path: /build/scrutiny-web-linux-arm-7 # asset_name: scrutiny-web-linux-arm-7 # asset_content_type: application/octet-stream # - name: Release Asset - Collector - linux-arm-7 # id: upload-release-asset10 # uses: actions/upload-release-asset@v1 # env: # GITHUB_TOKEN: ${{ secrets.SCRUTINY_GITHUB_TOKEN }} # with: # upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps # asset_path: /build/scrutiny-collector-metrics-linux-arm-7 # asset_name: scrutiny-collector-metrics-linux-arm-7 # asset_content_type: application/octet-stream