Skip to content
Permalink
Browse files
Adds release workflow (#1009)
Migrates workflows from travis-ci.org to GitHub Actions.

For APICLI-490
  • Loading branch information
scotchneat committed Jul 28, 2021
1 parent c9dcc4d commit 32d78af145d680839de29d9d1b52b23833f90c3f
Showing with 102 additions and 1 deletion.
  1. +69 −0 .github/workflows/release.yml
  2. +32 −0 .github/workflows/snapcraft-candidate.yml
  3. +1 −1 .goreleaser.yml
@@ -0,0 +1,69 @@
name: tagged-release

on:
push:
tags:
- 'v[1-9].[0-9]+.[0-9]+'

jobs:
github-release:
name: 'GitHub Release'
runs-on: 'ubuntu-latest'
steps:
- name: Checkout code
uses: actions/[email protected]
with:
# https://github.com/marketplace/actions/goreleaser-action#usage
# note the fetch-depth: 0 input in Checkout step. It is required for
# the changelog to work correctly
fetch-depth: 0

- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Install Go
uses: actions/[email protected]
- name: Restore cache
uses: actions/[email protected]
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run GoReleaser
uses: goreleaser/[email protected]
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

snapcraft-stable:
name: 'Snapcraft: Stable Release'
runs-on: 'ubuntu-latest'
steps:
- name: Checkout code
uses: actions/[email protected]

- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Buld snap
id: build
run: |
make _build_snap && \
find doctl_v*.snap -print -exec echo ::set-output name=snap::{} \;
- uses: snapcore/[email protected]
with:
store_login: ${{ secrets.SNAP_TOKEN }}
snap: ${{ steps.build.outputs.snap }}
release: stable
@@ -0,0 +1,32 @@
name: snapcraft-candidate
# Builds and publishes the package to the candidate channel on merge to main.

on:
push:
branches: [main]

jobs:
build-and-publish:
name: 'Snapcraft: Candidate Release'
runs-on: 'ubuntu-latest'
steps:
- name: Checkout code
uses: actions/[email protected]

- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Buld snap
id: build
run: |
make _build_snap && \
find doctl_v*.snap -print -exec echo ::set-output name=snap::{} \;
- uses: snapcore/[email protected]
with:
store_login: ${{ secrets.SNAP_TOKEN }}
snap: ${{ steps.build.outputs.snap }}
release: candidate
@@ -50,4 +50,4 @@ release:
name: doctl

changelog:
skip: true
skip: false

0 comments on commit 32d78af

Please sign in to comment.