|
| 1 | +name: Release |
| 2 | +permissions: |
| 3 | + contents: write |
| 4 | + pull-requests: write |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - main |
| 9 | + workflow_dispatch: # can be manually dispatched under GitHub's "Actions" tab |
| 10 | + |
| 11 | +concurrency: |
| 12 | + group: '${{ github.workflow }} @ ${{ github.ref }}' |
| 13 | + cancel-in-progress: false |
| 14 | + |
| 15 | +jobs: |
| 16 | + release: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - name: Checkout repository |
| 20 | + uses: actions/checkout@v4 |
| 21 | + with: |
| 22 | + submodules: true |
| 23 | + - name: Checkout Flatpak repository |
| 24 | + uses: actions/checkout@v4 |
| 25 | + with: |
| 26 | + fetch-depth: 0 |
| 27 | + ref: flatpak-repository |
| 28 | + path: repo |
| 29 | + - name: Setup GPG |
| 30 | + id: import-gpg |
| 31 | + uses: crazy-max/ghaction-import-gpg@v6 |
| 32 | + with: |
| 33 | + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} |
| 34 | + passphrase: ${{ secrets.GPG_PASSPHRASE }} |
| 35 | + git_config_global: true |
| 36 | + git_user_signingkey: true |
| 37 | + git_commit_gpgsign: true |
| 38 | + - name: Install dependencies |
| 39 | + run: | |
| 40 | + DEBIAN_FRONTEND=noninteractive sudo apt-get update -y |
| 41 | + git config --global protocol.file.allow always |
| 42 | + sudo apt-get install --no-install-recommends -y \ |
| 43 | + icoutils \ |
| 44 | + flatpak \ |
| 45 | + flatpak-builder \ |
| 46 | + elfutils \ |
| 47 | + rsync \ |
| 48 | + imagemagick |
| 49 | + - name: Build Flatpak |
| 50 | + env: |
| 51 | + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} |
| 52 | + GPG_KEY_GREP: ${{ secrets.GPG_KEY_GREP }} |
| 53 | + |
| 54 | + run: | |
| 55 | + # gpg --import --batch ${GPG_PRIVATE_KEY} |
| 56 | + # echo "allow-preset-passphrase" >> ~/.gnupg/gpg-agent.conf |
| 57 | + # gpg-connect-agent reloadagent /bye |
| 58 | + # cat $GPG_PASSPHRASE | /usr/libexec/gpg-preset-passphrase --preset $GPG_KEY_GREP |
| 59 | + # gpg --import --batch ${GPG_PRIVATE_KEY} |
| 60 | + |
| 61 | + flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo |
| 62 | + ./build.sh |
| 63 | + - name: Push Flatpak repository |
| 64 | + run: | |
| 65 | + rsync -a ./out/ ./repo/ |
| 66 | + cd repo |
| 67 | + touch test |
| 68 | + git add -A |
| 69 | + git commit --signoff -m "Update com.jagexlauncher.JagexLauncher" |
| 70 | + git reset $(git commit-tree HEAD^{tree} -m "Update com.jagexlauncher.JagexLauncher") |
| 71 | + git push --progress -f origin flatpak-repository |
| 72 | + env: |
| 73 | + GIT_AUTHOR_NAME: ${{ steps.import-gpg.outputs.name }} |
| 74 | + GIT_AUTHOR_EMAIL: ${{ steps.import-gpg.outputs.email }} |
| 75 | + GIT_COMMITTER_NAME: ${{ steps.import-gpg.outputs.name }} |
| 76 | + GIT_COMMITTER_EMAIL: ${{ steps.import-gpg.outputs.email }} |
| 77 | + GITHUB_TOKEN: ${{ secrets.PAT }} |
0 commit comments