Skip to content

Commit

Permalink
ci: Add release workflow for Craft automation (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilogorek authored Feb 24, 2022
1 parent 14a3781 commit 7d90513
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .craft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
minVersion: 0.29.2
changelogPolicy: auto
artifactProvider:
name: none
targets:
- name: pub-dev
- name: github
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: release
on:
workflow_dispatch:
inputs:
version:
description: Version to release
required: true
force:
description: Force a release even when there are release-blockers (optional)
required: false
jobs:
release:
runs-on: ubuntu-latest
name: "Release a new version"
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GH_RELEASE_PAT }}
fetch-depth: 0
- name: Prepare release
uses: getsentry/action-prepare-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
with:
version: ${{ github.event.inputs.version }}
force: ${{ github.event.inputs.force }}
14 changes: 14 additions & 0 deletions scripts/bump-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
set -euo pipefail

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $SCRIPT_DIR/..

OLD_VERSION="${1}"
NEW_VERSION="${2}"

echo "Current version: ${OLD_VERSION}"
echo "Bumping version: ${NEW_VERSION}"

# Bump version in pubspec.yaml
perl -pi -e "s/^version: .*/version: $NEW_VERSION/" pubspec.yaml

0 comments on commit 7d90513

Please sign in to comment.