From 180963c36342b0255bd056d0a615ab9ea4e5bde7 Mon Sep 17 00:00:00 2001 From: valmojr Date: Fri, 20 Oct 2023 23:22:36 -0300 Subject: [PATCH] adicionados workflows de PR e publish --- .github/workflows/build.yaml | 34 +++++++++++++++++++ .github/workflows/publish.yml | 52 ++++++++++++++++++++++++++++ .github/workflows/release_dev.yml | 56 ------------------------------- 3 files changed, 86 insertions(+), 56 deletions(-) create mode 100644 .github/workflows/build.yaml create mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/release_dev.yml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..9221579 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,34 @@ +name: Build + +on: + push: + branches: + - dev + pull_request: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout the source code + uses: actions/checkout@v3 + - name: Lint (sqflint) + uses: arma-actions/sqflint@master + continue-on-error: true + + build: + runs-on: ubuntu-latest + steps: + - name: Checkout the source code + uses: actions/checkout@v3 + - name: Setup HEMTT + uses: arma-actions/hemtt@v1 + - name: Run HEMTT build + run: hemtt release + - name: Extract Zipped Mod + run: unzip releases/braf_factions-latest.zip -d releases + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: braf_factions-${{ github.sha }} + path: releases/@braf_factions diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..6a73394 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,52 @@ +name: Publish + +on: + push: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout the source code + uses: actions/checkout@v3 + - name: Lint (sqflint) + uses: arma-actions/sqflint@master + continue-on-error: true + + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout the source code + uses: actions/checkout@v3 + - name: Setup HEMTT + uses: arma-actions/hemtt@v1 + - name: Run HEMTT build + run: hemtt release + - name: Extract Zipped Mod + run: unzip releases/braf_factions-latest.zip -d releases + - uses: arma-actions/workshop-upload@v1 + with: + appId: '107410' + itemId: ${{ secrets.STEAM_WORKSHOP_ITEM_ID }} + contentPath: releases/@braf_factions + changelog: 'Update' + env: + STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }} + STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }} + - name: Discord notification + uses: tsickert/discord-webhook@v5.3.0 + with: + webhook-url: ${{ secrets.DISCORD_WEBHOOK }} + username: Saci + avatar-url: https://scontent.fpoa33-1.fna.fbcdn.net/v/t1.6435-9/123089286_2720897204844263_4695033759855672932_n.jpg?_nc_cat=102&ccb=1-7&_nc_sid=810d5f&_nc_eui2=AeHYW_2fgJH67ADthIzboTmE_dndmKxNqvb92d2YrE2q9oc1UC5FYvsZ-cUbwpH19bbxxRLaBL159Gtrl1Ug8_dM&_nc_ohc=UeyYATHroS8AX9MnQDS&_nc_ht=scontent.fpoa33-1.fna&oh=00_AfD1hpwiRVRZXYafCTkpgEIX_ZyCHNKey4zoP6zsin_bMg&oe=655AAACE + embed-title: ${{ github.repository }} ATUALIZADO E PUBLICADO! + embed-url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ' + embed-description: Commit ${{ github.sha }} - ${{ github.event.head_commit.message }} autorizado e mod publicado no Steam Workshop! + embed-author-name: ${{ github.actor }} + embed-author-url: https://github.com/${{ github.actor }} + embed-author-icon-url: https://avatars.githubusercontent.com/${{ github.actor }} + embed-footer-icon-url: https://avatars.githubusercontent.com/${{ github.repository_owner }} + embed-footer-text: ${{ github.repository_owner }} + embed-color: 16515072 diff --git a/.github/workflows/release_dev.yml b/.github/workflows/release_dev.yml deleted file mode 100644 index 443de6b..0000000 --- a/.github/workflows/release_dev.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Release - -on: - push: - branches: - - main - -jobs: - validate: - runs-on: ubuntu-latest - steps: - - name: Checkout the source code - uses: actions/checkout@v3 - - name: Validate SQF - run: python3 tools/sqf_validator.py - - name: Validate Config - run: python3 tools/config_style_checker.py - - name: Check Strings - run: python3 tools/check_strings.py - - name: Check for BOM - uses: arma-actions/bom-check@v1 - - lint: - runs-on: ubuntu-latest - steps: - - name: Checkout the source code - uses: actions/checkout@v3 - - name: Lint (sqflint) - uses: arma-actions/sqflint@master - continue-on-error: true # No failure due to many false-positives - - build_and_release: - runs-on: ubuntu-latest - steps: - - name: Checkout the source code - uses: actions/checkout@v3 - - name: Setup HEMTT - uses: arma-actions/hemtt@v1 - - name: Run HEMTT release - run: hemtt release - - name: Rename build folder - run: mv .hemttout/release .hemttout/@braf_factions - - name: Upload to Steam Workshop (DEV) - uses: actions/upload-artifact@v3 - with: - name: braf_factions_${{ github.sha }} - path: .hemttout/@* - - uses: arma-actions/workshop-upload@v1 - with: - appId: '107410' # default - itemId: '2740442349' # Id of item to update - contentPath: '@braf_factions' - changelog: 'Version ${{ env.VERSION }} update' - env: - STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }} - STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }}