Skip to content

Release

Release #4

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
release_type:
description: Type of release
type: choice
required: true
options:
- patch
- minor
- major
jobs:
test:
name: Test
uses: Mobelux/swift-aws-extras/.github/workflows/test.yml@main
release:
name: Release
runs-on: ubuntu-latest
needs: test
permissions:
contents: write
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Get latest release version
id: get_current_version
uses: actions/github-script@v7
with:
script: |
const { data: { tag_name } } = await github.rest.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo
})
return tag_name
- name: Bump version
id: bump
uses: ./.github/actions/bump-version
with:
release-type: ${{ inputs.release_type }}
current-version: ${{ steps.get_current_version.outputs.result }}
- name: Push tag
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ steps.bump.outputs.version }}',
sha: context.sha
})
- name: Create release
uses: actions/github-script@v7
with:
script: |
github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: '${{ steps.bump.outputs.version }}',
generate_release_notes: true,
draft: false,
prerelease: false
})