Finish migration to GitHub Actions (#4836)

* Fix 'if' condition syntax in Actions workflow

Strings in expressions need to be in single quotes:
https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#literals

* Delete .travis.yml

We moved to GitHub Actions

* Inline git-related environment variables

* Inline the build number variable

* Rename TRAVIS_BRANCH to TW5_BUILD_BRANCH

Since we don't use Travis anymore

* Update developer documentation regardgin which CI service is used

* Document the decision about setting env vars in the workflow file
This commit is contained in:
ento 2020-08-29 02:58:34 -08:00 committed by GitHub
parent e332bb1728
commit ef29d05ea4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 52 deletions

View file

@ -5,9 +5,6 @@ on:
- master
- tiddlywiki-com
env:
COMMIT_CONTEXT: "GitHub build"
COMMIT_EMAIL: "actions@github.com"
COMMIT_NAME: "GitHub Actions"
NODE_VERSION: "12"
jobs:
test:
@ -32,17 +29,23 @@ jobs:
with:
node-version: "${{ env.NODE_VERSION }}"
- run: "./bin/ci-pre-build.sh"
# There's another near-duplicate "Set dynamic environment variables" step in
# the `build-tiddlywiki-com` job.
# These _could_ be extracted as a script (or moved into `ci-pre-build.sh`) to do away with the
# duplication, but, the visibility that comes from having these in the workflow file seems
# valuable. Environment variables are global variables and setting them at the top-level
# makes sense.
# Time to reconsider this decision might be when this setup turns out to be mistake-prone.
- name: "Set dynamic environment variables"
run: |
TRAVIS_BRANCH=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')
echo ::set-env name=TRAVIS_BRANCH::${TRAVIS_BRANCH}
TW5_BUILD_BRANCH=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')
echo ::set-env name=TW5_BUILD_BRANCH::${TW5_BUILD_BRANCH}
echo ::set-env name=TW5_BUILD_VERSION::$(./bin/get-plugin-library-version-number)
echo ::set-env name=TW5_BUILD_DETAILS::Prerelease built from branch \'$TRAVIS_BRANCH\' at commit $(git rev-parse HEAD) of $(git remote get-url origin) at $(date +'%F %T %Z')
echo ::set-env name=TW5_BUILD_DETAILS::Prerelease built from branch \'$TW5_BUILD_BRANCH\' at commit $(git rev-parse HEAD) of $(git remote get-url origin) at $(date +'%F %T %Z')
- run: "./bin/build-site.sh"
- run: "./bin/ci-push.sh"
env:
GH_TOKEN: ${{ secrets.GITHUB_PUSH_TOKEN }}
TRAVIS_BUILD_NUMBER: ${{ github.run_number }}
build-tiddlywiki-com:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/tiddlywiki-com'
@ -57,14 +60,15 @@ jobs:
with:
node-version: "${{ env.NODE_VERSION }}"
- run: "./bin/ci-pre-build.sh"
# When making a change here, don't forget to see if it also applies to the step
# with the same name in the `build-prerelease` job.
- name: "Set dynamic environment variables"
run: |
TRAVIS_BRANCH=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')
echo ::set-env name=TRAVIS_BRANCH::${TRAVIS_BRANCH}
TW5_BUILD_BRANCH=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')
echo ::set-env name=TW5_BUILD_BRANCH::${TW5_BUILD_BRANCH}
echo ::set-env name=TW5_BUILD_VERSION::$(./bin/get-plugin-library-version-number)
echo ::set-env name=TW5_BUILD_DETAILS::Built from branch \'$TRAVIS_BRANCH\' at commit $(git rev-parse HEAD) of $(git remote get-url origin) at $(date +'%F %T %Z')
echo ::set-env name=TW5_BUILD_DETAILS::Built from branch \'$TW5_BUILD_BRANCH\' at commit $(git rev-parse HEAD) of $(git remote get-url origin) at $(date +'%F %T %Z')
- run: "./bin/build-site.sh"
- run: "./bin/ci-push.sh"
env:
GH_TOKEN: ${{ secrets.GITHUB_PUSH_TOKEN }}
TRAVIS_BUILD_NUMBER: ${{ github.run_number }}