Windows wireguard service support #23
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
pull_request_target: | |
types: [closed] | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
GH_USER: MysteriumTeam | |
GH_EMAIL: [email protected] | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ env.GH_TOKEN }} | |
- run: git config --global user.name "${GH_USER}" | |
- run: git config --global user.email "${GH_EMAIL}" | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
cache: true | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Determine version number | |
run: | | |
VERSION=$(grep 'version: ' pubspec.yaml | awk '{print $2}') | |
if [[ ${{ github.event.pull_request.merged }} == 'true' ]]; then | |
PR_TITLE=$(echo ${{ github.event.pull_request.title }} | tr '[:upper:]' '[:lower:]') | |
if [[ $PR_TITLE == *'[major]'* ]]; then | |
echo "Merging pull request with [major] in title. Bumping major version." | |
NEW_VERSION=$(echo $VERSION | awk -F. '{print $1+1".0.0"}') | |
elif [[ $PR_TITLE == *'[minor]'* ]]; then | |
echo "Merging pull request with [minor] in title. Bumping minor version." | |
NEW_VERSION=$(echo $VERSION | awk -F. '{print $1"."$2+1".0"}') | |
else | |
echo "Merging pull request. Bumping patch version." | |
NEW_VERSION=$(echo $VERSION | awk -F. '{print $1"."$2"."$3+1}') | |
fi | |
sed -i "s/version: $VERSION/version: $NEW_VERSION/" pubspec.yaml | |
git add pubspec.yaml | |
git commit -m "Bump version to $NEW_VERSION" | |
echo "NEW_VERSION=$NEW_VERSION" >> "$GITHUB_ENV" | |
else | |
echo "Closing pull request without merging. No version bump required." | |
fi | |
- name: Create Github release | |
uses: softprops/action-gh-release@v1 | |
with: | |
token: ${{ env.GH_TOKEN }} | |
tag_name: ${{ env.NEW_VERSION }} | |
generate_release_notes: true | |
- name: Generate changelog | |
uses: charmixer/auto-changelog-action@v1 | |
with: | |
token: ${{ env.GH_TOKEN }} | |
- name: Commit changelog | |
run: git add CHANGELOG.md && git commit -m 'Update CHANGELOG' && echo "push=true" >> $GITHUB_ENV || echo "No changes to CHANGELOG" | |
- name: Push changelog | |
if: env.push == 'true' | |
run: git push "https://${GH_USER}:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" HEAD:master |