Update changelog for v1.4.0 #64
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: Build | |
on: | |
push: | |
tags: | |
- '[0-9]*' | |
# Allows manual execution of jobs | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: | |
image: jtackaberry/luadox:latest | |
steps: | |
- name: Set environment variables | |
run: | | |
echo "tag=$(echo $GITHUB_REF | sed s,.*/,,)" >> $GITHUB_ENV | |
echo "major=$(echo $GITHUB_REF | sed 's,.*/,,' | sed 's/\..*//')" >> $GITHUB_ENV | |
- name: Checkout tag ${{env.tag}} | |
uses: actions/checkout@v2 | |
- name: Build rtk | |
run: | | |
mkdir -p build/dist/${{env.major}} | |
python3 tools/luaknit.py rtk=rtk/ -c "This is generated code. See https://reapertoolkit.dev/ for more info.\nversion: ${{env.tag}}\nbuild: $(date)" -p "__RTK_VERSION='${{env.tag}}'" > build/dist/${{env.major}}/rtk.lua | |
ls -l build/dist/${{env.major}}/rtk.lua | |
- name: Pull changes for ${{env.tag}} from change log | |
run: | | |
mkdir -p build/dist/${{env.major}} | |
sed -n "/^## ${{env.tag}}/,/^## /p" CHANGELOG.md | sed '${/^## /d};s/^##/#/g;s/^##/#/g' > build/dist/${{env.major}}/CHANGELOG.md | |
cat build/dist/${{env.major}}/CHANGELOG.md | |
- name: Upload dist artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: dist | |
path: build/dist | |
retention-days: 1 | |
dist: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set environment variables | |
run: | | |
echo "tag=$(echo $GITHUB_REF | sed s,.*/,,)" >> $GITHUB_ENV | |
echo "release=$(date +%Y%m%dT%H%M%S)" >> $GITHUB_ENV | |
- name: Checkout dist branch | |
uses: actions/checkout@v2 | |
with: | |
ref: 'dist' | |
- name: Download dist artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: dist | |
- name: Update MANIFEST | |
run: | | |
(cat MANIFEST | grep -v "^$(echo ${{env.tag}} | sed 's/\..*//')"; echo ${{env.tag}}) | sort > MANIFEST.new || true | |
mv -f MANIFEST.new MANIFEST | |
echo "Manifest is" | |
cat MANIFEST | |
- name: Configure Git | |
run: | | |
git config --global user.name 'GitHub CI Bot' | |
git config --global user.email '[email protected]' | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY | |
- name: Commit new build for ${{env.tag}} | |
run: | | |
git add * | |
git commit -am "Generate build for ${{env.tag}}" && git push origin dist || echo "Build files did not change" | |
- name: Tag release for latest API versions | |
if: ${{ startsWith(github.ref, 'refs/tags/1') }} | |
run: | | |
mkdir -p -m 700 ~/.ssh | |
echo "${{secrets.RTK_DEPLOY_KEY}}" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/* | |
git remote set-url origin [email protected]:${GITHUB_REPOSITORY} | |
git tag release/${{env.release}} | |
git push origin release/${{env.release}} | |
rm -rf ~/.ssh |