Merge pull request #66 from lederniermetre/release-please--branches--… #221
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
permissions: | |
contents: read | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Golang | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: "go.mod" | |
- name: Prepare | |
run: | | |
download_url=$(curl -s https://api.github.com/repos/go-swagger/go-swagger/releases/latest | \ | |
jq -r '.assets[] | select(.name | contains("'"$(uname | tr '[:upper:]' '[:lower:]')"'_amd64")) | .browser_download_url') | |
sudo curl -s -o /usr/local/bin/swagger -L'#' "$download_url" | |
sudo chmod +x /usr/local/bin/swagger | |
swagger generate client -f https://developer.shortcut.com/api/rest/v3/shortcut.swagger.json --target pkg/shortcut/gen/ | |
- name: Install Task | |
uses: arduino/setup-task@v2 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Tests | |
run: | | |
task tests | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --clean --snapshot | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |