From 3d684447a56e831920ada8db2ef402d3068334e1 Mon Sep 17 00:00:00 2001 From: ChristopherHX Date: Sun, 26 Jan 2025 12:20:26 +0100 Subject: [PATCH] make ci run in this fork (#9) --- .github/actions/choco/entrypoint.sh | 2 +- .github/workflows/checks.yml | 26 ++++++++++++------------- .github/workflows/release.yml | 17 +++++++++++++--- README.md | 2 +- pkg/runner/testdata/issue-1195/push.yml | 2 +- 5 files changed, 30 insertions(+), 19 deletions(-) diff --git a/.github/actions/choco/entrypoint.sh b/.github/actions/choco/entrypoint.sh index 58a518b6..2ee9e00b 100755 --- a/.github/actions/choco/entrypoint.sh +++ b/.github/actions/choco/entrypoint.sh @@ -24,7 +24,7 @@ rm -f act-cli.*.nupkg mkdir -p tools cp LICENSE tools/LICENSE.txt cp VERIFICATION tools/VERIFICATION.txt -cp dist/act_windows_amd64_v1/act.exe tools/ +cp dist/act-cli_windows_amd64_v1/act-cli.exe tools/ choco pack act-cli.nuspec --version ${VERSION} if [[ "$INPUT_PUSH" == "true" ]]; then choco push act-cli.${VERSION}.nupkg --api-key ${INPUT_APIKEY} -s https://push.chocolatey.org/ --timeout 180 diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index eb54928e..bdd89355 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -27,7 +27,7 @@ jobs: version: v1.62 - uses: megalinter/megalinter/flavors/go@v8.3.0 env: - DEFAULT_BRANCH: master + DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} VALIDATE_ALL_CODEBASE: false GITHUB_STATUS_REPORTER: ${{ !env.ACT }} @@ -117,73 +117,73 @@ jobs: uses: actions/upload-artifact@v4 with: name: act-linux-amd64 - path: dist/act_linux_amd64_v1/act + path: dist/act-cli_linux_amd64_v1/act-cli - name: Capture i386 (32-bit) Linux binary if: ${{ !env.ACT }} uses: actions/upload-artifact@v4 with: name: act-linux-i386 - path: dist/act_linux_386/act + path: dist/act-cli_linux_386/act-cli - name: Capture arm64 (64-bit) Linux binary if: ${{ !env.ACT }} uses: actions/upload-artifact@v4 with: name: act-linux-arm64 - path: dist/act_linux_arm64/act + path: dist/act-cli_linux_arm64/act-cli - name: Capture armv6 (32-bit) Linux binary if: ${{ !env.ACT }} uses: actions/upload-artifact@v4 with: name: act-linux-armv6 - path: dist/act_linux_arm_6/act + path: dist/act-cli_linux_arm_6/act-cli - name: Capture armv7 (32-bit) Linux binary if: ${{ !env.ACT }} uses: actions/upload-artifact@v4 with: name: act-linux-armv7 - path: dist/act_linux_arm_7/act + path: dist/act-cli_linux_arm_7/act-cli - name: Capture riscv64 (64-bit) Linux binary if: ${{ !env.ACT }} uses: actions/upload-artifact@v4 with: name: act-linux-riscv64 - path: dist/act_linux_riscv64/act + path: dist/act-cli_linux_riscv64/act-cli - name: Capture x86_64 (64-bit) Windows binary if: ${{ !env.ACT }} uses: actions/upload-artifact@v4 with: name: act-windows-amd64 - path: dist/act_windows_amd64_v1/act.exe + path: dist/act-cli_windows_amd64_v1/act-cli.exe - name: Capture i386 (32-bit) Windows binary if: ${{ !env.ACT }} uses: actions/upload-artifact@v4 with: name: act-windows-i386 - path: dist/act_windows_386/act.exe + path: dist/act-cli_windows_386/act-cli.exe - name: Capture arm64 (64-bit) Windows binary if: ${{ !env.ACT }} uses: actions/upload-artifact@v4 with: name: act-windows-arm64 - path: dist/act_windows_arm64/act.exe + path: dist/act-cli_windows_arm64/act-cli.exe - name: Capture armv7 (32-bit) Windows binary if: ${{ !env.ACT }} uses: actions/upload-artifact@v4 with: name: act-windows-armv7 - path: dist/act_windows_arm_7/act.exe + path: dist/act-cli_windows_arm_7/act-cli.exe - name: Capture x86_64 (64-bit) MacOS binary if: ${{ !env.ACT }} uses: actions/upload-artifact@v4 with: name: act-macos-amd64 - path: dist/act_darwin_amd64_v1/act + path: dist/act-cli_darwin_amd64_v1/act-cli - name: Capture arm64 (64-bit) MacOS binary if: ${{ !env.ACT }} uses: actions/upload-artifact@v4 with: name: act-macos-arm64 - path: dist/act_darwin_arm64/act + path: dist/act-cli_darwin_arm64/act-cli - name: Chocolatey uses: ./.github/actions/choco with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2dd64a69..b9379bd2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,7 @@ on: jobs: release: + # TODO use environment to scope secrets name: release runs-on: ubuntu-latest steps: @@ -29,26 +30,33 @@ jobs: version: latest args: release --clean env: - GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN || github.token }} - name: Winget uses: vedantmgoyal2009/winget-releaser@v2 with: identifier: nektos.act installers-regex: '_Windows_\w+\.zip$' token: ${{ secrets.WINGET_TOKEN }} + if: env.ENABLED + env: + ENABLED: ${{ secrets.WINGET_TOKEN && '1' || '' }} - name: Chocolatey uses: ./.github/actions/choco with: version: ${{ github.ref }} apiKey: ${{ secrets.CHOCO_APIKEY }} push: true + if: env.ENABLED + env: + ENABLED: ${{ secrets.CHOCO_APIKEY && '1' || '' }} + # TODO use ssh deployment key - name: GitHub CLI extension uses: actions/github-script@v7 with: - github-token: ${{ secrets.GORELEASER_GITHUB_TOKEN }} + github-token: ${{ secrets.CLI_GITHUB_TOKEN || secrets.GORELEASER_GITHUB_TOKEN }} script: | const mainRef = (await github.rest.git.getRef({ - owner: 'nektos', + owner: context.repo.owner, repo: 'gh-act', ref: 'heads/main', })).data; @@ -59,3 +67,6 @@ jobs: ref: context.ref, sha: mainRef.object.sha, }); + if: env.ENABLED + env: + ENABLED: ${{ (secrets.CLI_GITHUB_TOKEN || secrets.GORELEASER_GITHUB_TOKEN) && '1' || '' }} diff --git a/README.md b/README.md index 26159e90..96e9bef0 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Please look at the [act user guide](https://nektosact.com) for more documentatio # Support -Need help? Ask on [Gitter](https://gitter.im/nektos/act)! +Need help? Ask on [Discussions](https://github.com/actions-oss/act-cli/discussions)! # Contributing diff --git a/pkg/runner/testdata/issue-1195/push.yml b/pkg/runner/testdata/issue-1195/push.yml index c211ad2c..c1e97e69 100644 --- a/pkg/runner/testdata/issue-1195/push.yml +++ b/pkg/runner/testdata/issue-1195/push.yml @@ -10,4 +10,4 @@ jobs: - name: print env.variable run: | echo ${{ env.variable }} - exit ${{ (env.variable == 'nektos') && '0' || '1'}} + exit ${{ (env.variable == 'actions-oss') && '0' || '1'}}