Publish #1169
This file contains hidden or 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: Publish | |
| on: | |
| push: {} | |
| workflow_dispatch: | |
| inputs: | |
| repository: | |
| description: 'Who called' | |
| required: false | |
| type: string | |
| schedule: | |
| - cron: '0 10,20 * * *' | |
| repository_dispatch: | |
| types: [publish] | |
| jobs: | |
| github-pages: | |
| name: Github Pages | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Called by ${{ inputs.repository }} | |
| shell: bash | |
| run: | | |
| echo 'called by ${{ inputs.repository }}' | |
| - name: Check out source repository | |
| uses: actions/checkout@v2 | |
| - name: Find Latest Flsr Tag | |
| id: data | |
| run: | | |
| echo "BUILD_VERSION=$(curl -s "https://api.github.com/repos/Freelancer-Sirius-Revival/FLSR/tags" | jq -r '.[0].name')" >> $GITHUB_OUTPUT | |
| - name: Cache Freelancer | |
| id: cache-freelancer | |
| uses: actions/cache@v3 | |
| with: | |
| key: ${{ runner.os }}-freelancer-${{ steps.data.outputs.BUILD_VERSION }} | |
| path: ${{ github.workspace }}/Freelancer | |
| - name: Cache FLHook | |
| id: cache-flhook | |
| uses: actions/cache@v3 | |
| with: | |
| key: ${{ runner.os }}-flhook-${{ steps.data.outputs.BUILD_VERSION }} | |
| path: ${{ github.workspace }}/FLHook | |
| - name: Load latest tag of flsr | |
| if: ${{ steps.cache-freelancer.outputs.cache-hit != 'true' || steps.cache-flhook.outputs.cache-hit != 'true' }} | |
| run: | | |
| git clone https://github.com/Freelancer-Sirius-Revival/FLSR.git | |
| cd FLSR | |
| git fetch --tags | |
| latestTag=$(git describe --tags "$(git rev-list --tags --max-count=1)") | |
| git checkout $latestTag | |
| cd .. | |
| rm -r Freelancer | true | |
| rm -r FLHook | true | |
| mv FLSR/Freelancer/ . | |
| mv FLSR/FLHook/ . | |
| - uses: darklab8/fl-darkstat/.github/actions/checkout-freelancer@master | |
| with: | |
| freelancer-mod: "vanilla" | |
| freelancer-folder: ${{ github.workspace }}/freelancer_folder | |
| - name: Set up Go | |
| uses: darklab8/infra/.github/actions/install-go@master | |
| - name: Merge latest tag FLSR files (from Freelancer) to clean vanilla (freelancer_folder) | |
| run: go run autopatch.go -wd ${{ github.workspace }}/freelancer_folder | |
| # actually everything is included? | |
| # - name: Sprinkle with FLSR recipes like FLSR-Crafting.cfg and FLSR missions | |
| # run: cp Freelancer/EXE/flhook_plugins -r ${{ github.workspace }}/freelancer_folder/EXE/flhook_plugins | |
| # - name: temporal fix to flsr bugs | |
| # shell: python | |
| # run: | | |
| # filename = "${{ github.workspace }}/freelancer_folder/DATA/UNIVERSE/SYSTEMS/BR06/br06.ini" | |
| # with open(filename, "r") as file: | |
| # data = file.read() | |
| # replaced = data.replace("faction = cl_01_grp, 0-8", "faction = cl_01_grp, 0.8") | |
| # with open(filename, "w") as file: | |
| # file.write(replaced) | |
| - uses: darklab8/fl-darkstat/.github/actions/build@master | |
| with: | |
| site-root: "/fl-data-flsr/" | |
| freelancer-folder: ${{ github.workspace }}/freelancer_folder | |
| heading: <a href="https://github.com/darklab8/fl-darkstat">Darkstat</a> from <a href="https://darklab8.github.io/blog/pet_projects.html#Freelancercommunity">DarkTools</a> for <a href="https://github.com/darklab8/fl-data-flsr">FLSR</a> of <a href="https://api.github.com/repos/Freelancer-Sirius-Revival/FLSR/tags">${{ steps.data.outputs.BUILD_VERSION }}</a> | |
| command: --stat-deals-on build | |
| map-on: "true" | |
| map-index-url: map.html | |
| disable-dev-mode: "false" | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| name: github-pages | |
| path: ./build | |
| # Turn on ability to deploy to pages in repository settings, Pages tab | |
| # choose "Github Actions" deployment method to Pages | |
| - name: Deploy to pages | |
| uses: actions/deploy-pages@v4 | |
| id: deployment |