From 250ac9bdbc5defb63df99c96b673a7ccab746069 Mon Sep 17 00:00:00 2001 From: Naramsim Date: Wed, 22 Jan 2025 21:58:00 +0100 Subject: [PATCH 1/4] feat: create release on tag with db dump --- .github/workflows/release.yml | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..7299686ed --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,39 @@ +name: Release + +on: + push: + # tags: + # - '*.*.*' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v3 + # - name: Set up Docker Buildx + # id: buildx + # uses: docker/setup-buildx-action@v3 + - name: Build + run: | + docker compose -f docker-compose.yml -f docker-compose-dev.yml up -d + make docker-migrate + make docker-build-db + - name: Dump DB + run: docker compose exec -T -u postgres db sh -c "cd /tmp && pg_dump -h localhost -Fc -U ash pokeapi | gzip > pokeapi.dump.zip && ls -larth" + - name: Copy dump + run: | + docker compose cp postgresql:/tmp pokeapi.dump.zip ./ + ls -larth + # - name: Release + # uses: softprops/action-gh-release@v2 + # if: startsWith(github.ref, 'refs/tags/') + # with: + # draft: true + # fail_on_unmatched_files: true + # files: pokeapi.dump.zip + # generate_release_notes: true From 77d5654055b371e790693a5e13522a5f2fa1c427 Mon Sep 17 00:00:00 2001 From: Naramsim Date: Wed, 22 Jan 2025 22:10:47 +0100 Subject: [PATCH 2/4] fix:container name --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7299686ed..68d831719 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: # - '*.*.*' jobs: - docker: + release: runs-on: ubuntu-latest steps: - name: Checkout @@ -27,7 +27,7 @@ jobs: run: docker compose exec -T -u postgres db sh -c "cd /tmp && pg_dump -h localhost -Fc -U ash pokeapi | gzip > pokeapi.dump.zip && ls -larth" - name: Copy dump run: | - docker compose cp postgresql:/tmp pokeapi.dump.zip ./ + docker compose cp db:/tmp pokeapi.dump.zip ./ ls -larth # - name: Release # uses: softprops/action-gh-release@v2 From 02f5a92ee6976781deccf9f4f6a04c1ead16f500 Mon Sep 17 00:00:00 2001 From: Naramsim Date: Wed, 22 Jan 2025 22:21:23 +0100 Subject: [PATCH 3/4] fix: path --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 68d831719..ca870ebe3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,7 +27,7 @@ jobs: run: docker compose exec -T -u postgres db sh -c "cd /tmp && pg_dump -h localhost -Fc -U ash pokeapi | gzip > pokeapi.dump.zip && ls -larth" - name: Copy dump run: | - docker compose cp db:/tmp pokeapi.dump.zip ./ + docker compose cp db:/tmp/pokeapi.dump.zip ./ ls -larth # - name: Release # uses: softprops/action-gh-release@v2 From b400fdc7a13a2ffc54faf6163b4cd5c0aa9d1609 Mon Sep 17 00:00:00 2001 From: Naramsim Date: Wed, 22 Jan 2025 23:08:00 +0100 Subject: [PATCH 4/4] feat: enable releasing --- .github/workflows/release.yml | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ca870ebe3..90fcb2df8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,8 +2,8 @@ name: Release on: push: - # tags: - # - '*.*.*' + tags: + - '*.*.*' jobs: release: @@ -13,27 +13,22 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v3 - # - name: Set up Docker Buildx - # id: buildx - # uses: docker/setup-buildx-action@v3 - name: Build run: | docker compose -f docker-compose.yml -f docker-compose-dev.yml up -d make docker-migrate make docker-build-db - name: Dump DB - run: docker compose exec -T -u postgres db sh -c "cd /tmp && pg_dump -h localhost -Fc -U ash pokeapi | gzip > pokeapi.dump.zip && ls -larth" + run: docker compose exec -T -u postgres db sh -c "cd /tmp && pg_dump -h localhost -Fc -U ash pokeapi | gzip > pokeapi.dump.zip" - name: Copy dump run: | docker compose cp db:/tmp/pokeapi.dump.zip ./ ls -larth - # - name: Release - # uses: softprops/action-gh-release@v2 - # if: startsWith(github.ref, 'refs/tags/') - # with: - # draft: true - # fail_on_unmatched_files: true - # files: pokeapi.dump.zip - # generate_release_notes: true + - name: Release + uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda + if: startsWith(github.ref, 'refs/tags/') + with: + draft: true + fail_on_unmatched_files: true + files: pokeapi.dump.zip + generate_release_notes: true