-
Notifications
You must be signed in to change notification settings - Fork 9
39 lines (32 loc) · 1.03 KB
/
default.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
- run: bundle install --jobs 4 --retry 3
- run: bundle exec rake
release:
needs: test
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' }}
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
# Update to >= v3.0.5
# https://gitlab.com/gitlab-org/gitlab-qa/-/issues/431
- run: gem update --system
- env:
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
run: |
VERSION=$(ruby -e "puts eval(File.read('rubocop-govuk.gemspec')).version")
GEM_VERSION=$(gem list --exact --remote rubocop-govuk)
if [ "${GEM_VERSION}" != "rubocop-govuk (${VERSION})" ]; then
gem build rubocop-govuk.gemspec
gem push "rubocop-govuk-${VERSION}.gem"
fi
if ! git ls-remote --tags --exit-code origin v${VERSION}; then
git tag v${VERSION}
git push --tags
fi