diff --git a/.github/workflows/package.yml b/.github/workflows/build.yml similarity index 75% rename from .github/workflows/package.yml rename to .github/workflows/build.yml index b423ca9..3955200 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/build.yml @@ -3,15 +3,14 @@ name: Build package on: push: - branches: [main] + branches: ['*'] pull_request: - branches: [main] + branches: ['*'] - # Allows you to run this workflow manually from the Actions tab workflow_dispatch: jobs: - build: + test-and-build: runs-on: ubuntu-latest steps: @@ -28,8 +27,8 @@ jobs: buildpackage-opts: --no-sign --check-command=lintian extra-build-deps: lintian - - name: Archive Debian artifacts + - name: Upload debian package as artifact uses: actions/upload-artifact@v2 with: - name: package + name: deb path: debian/artifacts diff --git a/.github/workflows/release-created.yml b/.github/workflows/release-created.yml new file mode 100644 index 0000000..285b6cc --- /dev/null +++ b/.github/workflows/release-created.yml @@ -0,0 +1,22 @@ +--- +name: Add package to release + +on: + release: + types: [created] + +jobs: + add-deb-to-release: + runs-on: ubuntu-latest + + steps: + - uses: dawidd6/action-download-artifact@v2 + with: + workflow: build.yml + commit: ${{ github.sha }} + + - name: Upload release artifact + uses: fnkr/github-action-ghr@v1 + env: + GHR_PATH: deb + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-published.yml b/.github/workflows/release-published.yml new file mode 100644 index 0000000..863e865 --- /dev/null +++ b/.github/workflows/release-published.yml @@ -0,0 +1,34 @@ +--- +name: Publish to apt repository + +on: + release: + types: [published] + +jobs: + publish-to-apt-repo: + runs-on: ubuntu-latest + + steps: + - uses: dawidd6/action-download-artifact@v2 + with: + workflow: build.yml + commit: ${{ github.sha }} + + - name: Release tailscale-initramfs on Github Pages repository + # peternewman/apt-repo-action@globs + uses: peternewman/apt-repo-action@ff037894ae6f9a6a40c56f0993d083adc23b7986 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + repo_supported_arch: | + amd64 + arm64 + armhf + i386 + repo_supported_version: stable + file: deb/tailscale-initramfs*.deb + file_target_version: stable + public_key: ${{ secrets.APT_SIGNING_PUBLIC }} + private_key: ${{ secrets.APT_SIGNING_PRIVATE }} + key_passphrase: ${{ secrets.APT_SIGNING_PASSPHRASE }} + debug: true