Incrementing version to 4.0 #46
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: Master CI | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Prepare system path for running python | |
run: echo "/home/runner/.local/bin" >> $GITHUB_PATH | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
#TODO: change to 1 and then get all tags seperately to see if that's faster. git fetch origin 'refs/tags/*:refs/tags/*' | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
# Create a git tag of the new version to use | |
# If package.json major and minor versions match last tag, then | |
# increment last tag. Else use package.json major.minor.0. | |
- name: Create git tag | |
run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
KEE_VERSION_MANIFEST=`sed -nE 's/^.*"version": "([0-9]{1,}\\.[0-9]{1,})\\.[0-9x]{1,}"\\,/\\1/p' package.json | tr -d '\\040\\011\\012\\015'`; KEE_VERSION_TAG=`git describe --abbrev=0 --tags | sed -E 's/^([0-9]{1,}\\.[0-9]{1,})\\.([0-9]{1,})$/\\1 \\2/g'`; echo "${KEE_VERSION_MANIFEST} ${KEE_VERSION_TAG}" | awk '{printf($1==$2?""$2"."$3+1:""$1".0")}' | xargs -I {} git tag -a {} -m "{}" | |
- name: Update package.json based on the git tag we just created | |
run: | | |
NEW_KEE_VERSION=`git describe --abbrev=0 --tags` | |
echo "NEW_KEE_VERSION=$NEW_KEE_VERSION" >> $GITHUB_ENV | |
sed -E 's/^(.*"version": ")(.*)("\,.*)/\1'"$NEW_KEE_VERSION"'\3/' package.json > package.json.tmp && mv package.json.tmp package.json | |
- name: Setup | |
run: | | |
npm ci | |
mkdir dist | |
- name: Build and package beta | |
run: npm run build:beta && npm run pack:beta | |
- name: Build and package production | |
run: npm run build:prod && npm run pack:prod | |
- name: Build and package Chrome beta | |
run: npm run build-chrome:beta && npm run pack-chrome:beta | |
- name: Build and package Chrome production | |
run: npm run build-chrome:prod && npm run pack-chrome:prod | |
# We have to do this type check after running the build | |
# because Vite creates various type definitions we need | |
- name: Compile Typescript | |
run: npm run tsc | |
# Disabled until MV3 rewrite | |
# - name: Test | |
# run: npm run test | |
- name: Lint | |
run: npm run lint | |
# - name: Transifex upload | |
# run: pip install transifex-client && echo $'[https://www.transifex.com]\nhostname = https://www.transifex.com\nusername = api\ntoken = \npassword = '"$TRANSIFEX_API_TOKEN"$'\n' > .transifexrc && tx -d --traceback push -s; | |
# env: | |
# TRANSIFEX_API_TOKEN: ${{ secrets.TRANSIFEX_API_TOKEN }} | |
- name: Transifex upload | |
uses: transifex/cli-action@v2 | |
with: | |
token: ${{ secrets.TRANSIFEX_API_TOKEN }} | |
- name: Push git tag | |
run: git push --tags | |
- name: Release | |
uses: softprops/action-gh-release@d4e8205d7e959a9107da6396278b2f1f07af0f9b | |
with: | |
name: ${{ env.NEW_KEE_VERSION }} | |
tag_name: ${{ env.NEW_KEE_VERSION }} | |
fail_on_unmatched_files: true | |
prerelease: true | |
body: "This is an automatically generated pre-release. Some releases will be thoroughly tested and their derivatives marked as ready for beta and eventually stable release. If the status of this version changes, this message will be replaced. You may want to install the files in this release if you wish to test a specific change that is included within this version. More information can be found at https://forum.kee.pm/t/versioning-and-releases/550" | |
files: | | |
dist/* |