Force release libsbp #16
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: Force release libsbp | |
on: | |
workflow_dispatch: | |
inputs: | |
major: | |
description: 'Semver major label' | |
required: true | |
minor: | |
description: 'Semver minor label' | |
required: true | |
patch: | |
description: 'Semver patch label' | |
required: true | |
env: | |
MAJOR: ${{ github.event.inputs.major }} | |
MINOR: ${{ github.event.inputs.minor }} | |
PATCH: ${{ github.event.inputs.patch }} | |
SEMVER: "${{ github.event.inputs.major }}.${{ github.event.inputs.minor }}.${{ github.event.inputs.patch }}" | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Echo inputs | |
run: | | |
echo "major: ${{ github.event.inputs.major }}" | |
echo "minor: ${{ github.event.inputs.minor }}" | |
echo "patch: ${{ github.event.inputs.patch }}" | |
echo "v$MAJOR.$MINOR.$PATCH" | |
- uses: actions/checkout@v2 | |
- name: Update C version | |
run: | | |
sed -i "s/define SBP_VERSION_MAJOR .*/define SBP_VERSION_MAJOR $MAJOR/" c/include/libsbp/version.h | |
sed -i "s/define SBP_VERSION_MINOR .*/define SBP_VERSION_MINOR $MINOR/" c/include/libsbp/version.h | |
sed -i "s/define SBP_VERSION_PATCH .*/define SBP_VERSION_PATCH $PATCH/" c/include/libsbp/version.h | |
sed -i "s/define SBP_VERSION \".*\"/define SBP_VERSION \"$SEMVER\"/" c/include/libsbp/version.h | |
- name: Update Haskell version | |
run: | | |
sed -i "s/version: .*/version: $MAJOR.$MINOR.$PATCH/" haskell/sbp.cabal | |
- name: Update Javascript version | |
run: | | |
echo "$MAJOR.$MINOR.$PATCH" > javascript/sbp/RELEASE-VERSION | |
sed -i "s/\"version\": \".*\"/\"version\": \"$SEMVER\"/" package.json | |
sed -i "s/\"version\": \".*\"/\"version\": \"$SEMVER\"/" package-lock.json | |
- name: Update Python version | |
run: | | |
echo "$MAJOR.$MINOR.$PATCH" > python/sbp/RELEASE-VERSION | |
- name: Update Rust version | |
run: | | |
sed -i "s/version = \".*\"/version = \"$SEMVER\"/" rust/sbp/Cargo.toml | |
sed -i "s/version = \".*\"/version = \"$SEMVER-unreleased\"/" rust/sbp2json/Cargo.toml | |
- name: Debug | |
run: git status | |
# - name: Update PDF | |
# run: echo "TODO" | |
# - name: Commit changes | |
# run: | | |
# git checkout -b "force-release-v$MAJOR.$MINOR.$PATCH" | |
# git add . | |
# git status | |
# git commit -m "force release v$MAJOR.$MINOR.$PATCH" | |
# git push --set-upstream origin "force-release-v$MAJOR.$MINOR.$PATCH" | |
- name: Create PR | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
commit-message: "chore: force release ${{ env.SEMVER }}" | |
title: "chore: force release ${{ env.SEMVER }}" | |
body: "chore: force release ${{ env.SEMVER }}" | |
branch: "force-release-${{ env.SEMVER }}" | |
base: "master" | |
branch-suffix: "force-release-${{ env.SEMVER }}" | |
delete-branch: true | |
author: swiftnav-travis | |
add-paths: | | |
* |