From d9ba3867f99197f403d0ffe2a94fd36ba7f3a6c7 Mon Sep 17 00:00:00 2001 From: MatteoSchiff Date: Wed, 13 Mar 2024 12:44:35 +0100 Subject: [PATCH 1/8] workflows: Add build workflow --- .gitea/workflows/build.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .gitea/workflows/build.yaml diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..4938de6 --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,26 @@ +name: Build artifact +run-name: Build from ${{ gitea.actor }} 🚀 +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.21 + + - name: Build + run: go build -v ./... + + - name: Test + run: go test -v ./... + + - name: Upload artifact + uses: actions/upload-artifact@v2.2.3 + with: + name: InnkeeperBot + path: ./InnkeeperBot \ No newline at end of file -- 2.34.1 From 611f73f48ab1515bdbe60328f52f9d963318bcaf Mon Sep 17 00:00:00 2001 From: MatteoSchiff Date: Wed, 13 Mar 2024 13:17:25 +0100 Subject: [PATCH 2/8] workflows: Update actions --- .gitea/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 4938de6..5930c6d 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -9,7 +9,7 @@ jobs: - uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: go-version: 1.21 @@ -20,7 +20,7 @@ jobs: run: go test -v ./... - name: Upload artifact - uses: actions/upload-artifact@v2.2.3 + uses: actions/upload-artifact@v4 with: name: InnkeeperBot path: ./InnkeeperBot \ No newline at end of file -- 2.34.1 From d95946bd4d65b1340f86f631cc347ceb0f298abb Mon Sep 17 00:00:00 2001 From: MatteoSchiff Date: Wed, 13 Mar 2024 13:22:39 +0100 Subject: [PATCH 3/8] workflows: Fix upload-artifact version not supported --- .gitea/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 5930c6d..18df9be 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -20,7 +20,7 @@ jobs: run: go test -v ./... - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: InnkeeperBot path: ./InnkeeperBot \ No newline at end of file -- 2.34.1 From 29f03992a428cbb844ca55656e54e0f683a03971 Mon Sep 17 00:00:00 2001 From: MatteoSchiff Date: Wed, 13 Mar 2024 14:28:50 +0100 Subject: [PATCH 4/8] workflows: Add release workflow --- .gitea/workflows/build.yaml | 2 +- .gitea/workflows/release.yaml | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/release.yaml diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 18df9be..51052fd 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -23,4 +23,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: InnkeeperBot - path: ./InnkeeperBot \ No newline at end of file + path: ./InnkeeperBot diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml new file mode 100644 index 0000000..4cfb08b --- /dev/null +++ b/.gitea/workflows/release.yaml @@ -0,0 +1,23 @@ +name: Release and publish +run-name: Release from ${{ gitea.actor }} 🚀 +on: + workflow_run: + workflows: ["Build artifact"] + #branches: [main] + types: + - completed + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v2 + with: + name: InnkeeperBot + - name: Use Go Action + id: use-go-action + uses: https://gitea.com/actions/release-action@main + with: + files: |- + InnkeeperBot + api_key: '${{secrets.RELEASE_TOKEN}}' -- 2.34.1 From f1d241ee6a750cfa66c60a2ee48a6a5d2a38e749 Mon Sep 17 00:00:00 2001 From: MatteoSchiff Date: Wed, 13 Mar 2024 14:44:06 +0100 Subject: [PATCH 5/8] workflows: Publish release using a job --- .gitea/workflows/build.yaml | 16 ++++++++++++++++ .gitea/workflows/release.yaml | 23 ----------------------- 2 files changed, 16 insertions(+), 23 deletions(-) delete mode 100644 .gitea/workflows/release.yaml diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 51052fd..6a75621 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -24,3 +24,19 @@ jobs: with: name: InnkeeperBot path: ./InnkeeperBot + + release: + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/download-artifact@v2 + with: + name: InnkeeperBot + - name: Release artifact + id: use-go-action + uses: https://gitea.com/actions/release-action@main + with: + files: |- + InnkeeperBot + api_key: '${{secrets.RELEASE_TOKEN}}' + diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml deleted file mode 100644 index 4cfb08b..0000000 --- a/.gitea/workflows/release.yaml +++ /dev/null @@ -1,23 +0,0 @@ -name: Release and publish -run-name: Release from ${{ gitea.actor }} 🚀 -on: - workflow_run: - workflows: ["Build artifact"] - #branches: [main] - types: - - completed - -jobs: - release: - runs-on: ubuntu-latest - steps: - - uses: actions/download-artifact@v2 - with: - name: InnkeeperBot - - name: Use Go Action - id: use-go-action - uses: https://gitea.com/actions/release-action@main - with: - files: |- - InnkeeperBot - api_key: '${{secrets.RELEASE_TOKEN}}' -- 2.34.1 From 51fa77b84bcc333dbc4ea563015c602ba492ec3b Mon Sep 17 00:00:00 2001 From: MatteoSchiff Date: Wed, 13 Mar 2024 14:46:50 +0100 Subject: [PATCH 6/8] workflow: go-action requires go --- .gitea/workflows/build.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 6a75621..bc4e192 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -32,6 +32,10 @@ jobs: - uses: actions/download-artifact@v2 with: name: InnkeeperBot + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: 1.21 - name: Release artifact id: use-go-action uses: https://gitea.com/actions/release-action@main -- 2.34.1 From 2abf750fc6a395b9ac4164e7ea314b25f6103b51 Mon Sep 17 00:00:00 2001 From: MatteoSchiff Date: Wed, 13 Mar 2024 14:58:37 +0100 Subject: [PATCH 7/8] ci: Release only on tag set --- .gitea/workflows/build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index bc4e192..0108f2e 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -38,6 +38,7 @@ jobs: go-version: 1.21 - name: Release artifact id: use-go-action + if: startsWith(gitea.event.ref, 'refs/tags/v') uses: https://gitea.com/actions/release-action@main with: files: |- -- 2.34.1 From 36a543f3b91862213de72855b9a2603042e412a4 Mon Sep 17 00:00:00 2001 From: Matte23 Date: Tue, 9 Jul 2024 22:39:28 +0200 Subject: [PATCH 8/8] workflow: Move release condition --- .gitea/workflows/build.yaml | 2 +- Dockerfile | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 0108f2e..38f1f55 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -28,6 +28,7 @@ jobs: release: runs-on: ubuntu-latest needs: build + if: startsWith(gitea.event.ref, 'refs/tags/v') steps: - uses: actions/download-artifact@v2 with: @@ -38,7 +39,6 @@ jobs: go-version: 1.21 - name: Release artifact id: use-go-action - if: startsWith(gitea.event.ref, 'refs/tags/v') uses: https://gitea.com/actions/release-action@main with: files: |- diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ef5ff1b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM scratch + +COPY InnkeeperBot / +RUN chmod a+x /InnkeeperBot -- 2.34.1