From 5ed58fbf07bde7171a9aeac9788934ec2530b396 Mon Sep 17 00:00:00 2001 From: Nick Whyte Date: Sat, 20 Nov 2021 00:39:15 +1100 Subject: [PATCH] Migrate to Github Actions (#5) --- .github/workflows/workflow.yaml | 30 ++++++++++++++ azure-pipelines.yml | 72 --------------------------------- 2 files changed, 30 insertions(+), 72 deletions(-) create mode 100644 .github/workflows/workflow.yaml delete mode 100644 azure-pipelines.yml diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml new file mode 100644 index 0000000..015b5f0 --- /dev/null +++ b/.github/workflows/workflow.yaml @@ -0,0 +1,30 @@ +on: + push: + schedule: + - cron: '0 3 * * 6' + + +jobs: + build: + name: "Build" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: '^1.17.3' + + - name: "Install Dependencies" + run: | + go mod download + + - name: "Build" + run: | + bin/deploy-compile.sh + + - name: Create Github Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags') + with: + generate_release_notes: true + files: target/* diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 6579de1..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,72 +0,0 @@ -trigger: - branches: - include: - - master - tags: - include: - - '*' - -schedules: -- cron: '0 3 * * 6' - displayName: "Weekly scheduled build" - branches: - include: - - 'master' - always: true - -pool: - vmImage: ubuntu-latest - -variables: - GOBIN: '$(GOPATH)/bin' # Go binaries path - GOROOT: '/usr/local/go1.11' # Go installation path - GOPATH: '$(system.defaultWorkingDirectory)/gopath' # Go workspace path - modulePath: '$(GOPATH)/src/github.com/$(build.repository.name)' # Path to the module's code - -steps: -- task: GoTool@0 - inputs: - version: '1.x' - -- script: | - mkdir -p '$(GOBIN)' - mkdir -p '$(GOPATH)/pkg' - mkdir -p '$(modulePath)' - shopt -s extglob - shopt -s dotglob - mv !(gopath) '$(modulePath)' - echo '##vso[task.prependpath]$(GOBIN)' - echo '##vso[task.prependpath]$(GOROOT)/bin' - displayName: 'Set up the Go workspace' - -- script: | - go mod download - workingDirectory: '$(modulePath)' - displayName: 'Get dependencies' - env: - GO111MODULE: 'on' - -- script: | - bin/deploy-compile.sh - workingDirectory: '$(modulePath)' - displayName: 'Compile' - env: - GO111MODULE: 'on' - -- task: GitHubRelease@1 - inputs: - gitHubConnection: 'github.com_nickw444' - repositoryName: '$(Build.Repository.Name)' - action: 'create' - target: '$(Build.SourceVersion)' - tagSource: 'gitTag' - assets: '$(modulePath)/target/*' - changeLogCompareToRelease: 'lastFullRelease' - changeLogType: 'commitBased' - condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/')) - -- task: PublishBuildArtifacts@1 - inputs: - PathtoPublish: '$(modulePath)/target/' - ArtifactName: 'build' - publishLocation: 'Container' \ No newline at end of file