Skip to content

Reduce redundancy in #abort_start code #2

Reduce redundancy in #abort_start code

Reduce redundancy in #abort_start code #2

Workflow file for this run

name: Release

Check failure on line 1 in .github/workflows/release.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yaml

Invalid workflow file

(Line: 9, Col: 3): The workflow must contain at least one job with no dependencies.
on:
push:
tags:
- "release-*"
jobs:
release:
runs-on: ubuntu-24.04
needs:
- lint-and-build
if: startsWith(github.ref, 'refs/tags/')
environment: release
permissions:
contents: write
id-token: write
attestations: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: true
- name: Verify version number
id: get_version
run: |
VERSION_STRING=$(ruby -r ./lib/daemon_controller/version.rb -e "puts DaemonController::VERSION_STRING")
if ! [[ "$GITHUB_REF_NAME" =~ ^release- ]]; then
echo "Tag name must start with a 'release-'."
exit 1
fi
if [[ "$GITHUB_REF_NAME" != "release-${VERSION_STRING}" ]]; then
echo "Tag version ($GITHUB_REF_NAME) does not match version.rb ($VERSION_STRING)"
exit 1
fi
- name: Build gem
run: gem build daemon_controller.gemspec
- name: Create attestation
uses: actions/attest-build-provenance@v2
with:
subject-path: "daemon_controller-*.gem"
- name: Push gem to RubyGems
run: gem push daemon_controller-*.gem
env:
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
- name: Create GitHub release
run: gh release create "$GITHUB_REF_NAME" *.gem --title "$GITHUB_REF_NAME" --notes-from-tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}