Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: clean-up dependencies on release #284

Merged
merged 1 commit into from Dec 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,56 @@
name: Release

on:
workflow_dispatch:
inputs:
semver:
type: string
description: Semver
required: true

jobs:
release:
if: github.triggering_actor == 'samber'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
stable: false

- name: Test
run: make test

# remove tests in order to clean dependencies
- name: Remove xxx_test.go files
run: rm -rf *_test.go ./parallel/*_test.go docker-compose.yml img/

# cleanup test dependencies
- name: Cleanup dependencies
run: go mod tidy

- name: List files
run: tree -Cfi
- name: Write new go.mod into logs
run: cat go.mod
- name: Write new go.sum into logs
run: cat go.sum

- name: Create tag
run: |
git config --global user.name '${{ github.triggering_actor }}'
git config --global user.email "${{ github.triggering_actor}}@users.noreply.github.com"

git add .
git commit -m 'bump ${{ inputs.semver }}'
git tag ${{ inputs.semver }}
git push origin ${{ inputs.semver }}

- name: Release
uses: softprops/action-gh-release@v1
with:
name: ${{ inputs.semver }}
tag_name: ${{ inputs.semver }}